1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kotegsom [21]
3 years ago
7

Pointers are addresses and have a numerical value. You can print out the value of a pointer as cout << (unsigned)(p). Writ

e a program to compare p, p + 1, q, and q + 1, where p is an int* and q is a double*. Explain the results.
Computers and Technology
1 answer:
lukranit [14]3 years ago
8 0

Answer:

#include <iostream>

using namespace std;

int main() {

  int i = 2;

  double j = 3;

 

  int *p = &i;

  double *q = &j;

 

  cout << "p = " << p << ", p+1 = " << p+1 << endl;

  cout << "q = " << q << ", q+1 = " << q+1 << endl;

  return 0;

}

Explanation:

In C++, pointers are variables or data types that hold the location of another variable in memory. It is denoted by asterisks in between the data type and pointer name during declaration.

The C++ source code above defines two pointers, "p" which is an integer pointer and "q", a double. The reference of the variables i and j are assigned to p and q respectively and the out of the pointers are the location of the i and j values in memory.

You might be interested in
You are researching RAM for a computer you are building for a friend who will be using the system as a home office server for he
pashok25 [27]

Answer:

ECC RAM

Explanation:

ECC RAM is the most popular Random Access Memory out there that is used by most business servers. Dealing with big data for most huge businesses is crucial. The need to prevent loss of data requires that they purchase ECC RAM. ECC RAM automatically protects the systems from potential errors that occur in memory. Any abrupt changes in temporary data stored in ECC RAM are automatically corrected. This is achieved by an additional memory chip that acts as error detection for the other eight RAM chips.

8 0
3 years ago
What is the output for the following program?
Lelu [443]

Answer:

Output:

15

20

25

Explanation:

In first iteration value of num is 10. Condition is checked 10 is less than 21 so value of num is incremented by 5 and value 15 is printed than again condition is checked 15<21 so value of num is incremented again and 20 is printed. Again condition is checked 20<21. So 25 is printed. Then 4th time when condition is checked vakue of num is 25 and while loop condition becomes false because 25 is not less than 21 and program is terminated here.

6 0
2 years ago
Which of the following is the smallest aperture (f-stop) opening?
Firlakuza [10]

Answer:

E) f/16

Explanation:

6 0
3 years ago
Which specific attribute of a team player helps remove ambiguity from tasks?
Rama09 [41]
If a team player knows how to follow the rules, ambiguities can be prevented. Each member would be guided by specific details of their tasks and procedures. There is a clear definition of work premises that can avoid overlapping of work. This can give better productive results.
5 0
3 years ago
Read 2 more answers
Interactive sites where users write about personal topics and comment to a threaded discussion are called A. networking sites. B
Viefleur [7K]

The answer is definitely C: Blogs.

Blog is somewhat very similar to a website. It is sort of a journal that is mostly maintained by one person, the blogger. They are updated regularly and can contain information related to a specific topic. In most cases, blogs are used as dairy diaries about politics, people’s personal lives, or social commentaries. They give you, as a blogger, opportunities to interact with your visitors while promoting your products.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is NOT an option in the comments group
    12·1 answer
  • The computers that run the DBMS and all devices that store database data should reside in locked, controlled-access facilities.
    15·1 answer
  • Changes in computer technology have an effect on _____.
    13·1 answer
  • Ng/ Computer Applications - Office 2016 - EL3520 A
    13·1 answer
  • nswer the following questions concerning chapter 1:1.1 Which pair of layers are NOT peer layers?a.Transport layer in the sender
    9·1 answer
  • After modifying the font of the Subheading1 style, you notice that the font of Subheading2 has also changed. What is the most li
    12·2 answers
  • What are the uses of plotters​
    7·2 answers
  • What type of error occurred with the code below??
    11·1 answer
  • What is Microsoft Excel?​
    13·1 answer
  • The users, groups, and roles that have access to a server are called ______________________________.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!