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
Lena [83]
3 years ago
8

Please explain this code line by line and how the values of each variable changes as you go down the code.

Computers and Technology
1 answer:
Scilla [17]3 years ago
6 0

Answer:

hope this helps. I am also a learner like you. Please cross check my explanation.

Explanation:

#include

#include

using namespace std;

int main()

{

int a[ ] = {0, 0, 0};  //array declared initializing a0=0, a1=0, a3=0

int* p = &a[1]; //pointer p is initialized it will be holding the address of a1 which means when p will be called it will point to whatever is present at the address a1, right now it hold 0.

int* q = &a[0];  //pointer q is initialized it will be holding the address of a0 which means when q will be called it will point to whatever is present at the address a0, right now it hold 0.

q=p; // now q is also pointing towards what p is pointing both holds the same address that is &a[1]

*q=1 ; //&a[0] gets overwritten and now pointer q has integer 1......i am not sure abut this one

p = a; //p is now holding address of complete array a

*p=1; // a gets overwritten and now pointer q has integer 1......i am not sure abut this one  

int*& r = p; //not sure

int** s = &q; s is a double pointer means it has more capacity of storage than single pointer and is now holding address of q

r = *s + 1; //not sure

s= &r; //explained above

**s = 1; //explained above

return 0;

}

You might be interested in
Http://www.alegrium.com/sgi/2/eibder
Flura [38]

Answer:

so what is this uhhhhhhhhhh

7 0
3 years ago
Your computer has two basic types of software: system software and ________ software.
Elan Coil [88]
Hi!

Our computers will have system software and application software. Application software would be something like a game or just any general purpose app you've downloaded.

Hopefully, this helps! =)
5 0
4 years ago
PLEASE SOMEONE ANSWER THIS
maw [93]
Maybe 7411 or someones birthday in the family
3 0
3 years ago
Read 2 more answers
What is the term for the era created by the digital revolution?
ollegr [7]
We are in the modern era and the information era
8 0
3 years ago
A computer can read whatever you type into it.<br> A)True<br> B)False
motikmotik

Answer:

True

Explanation:

Everything typed into a computer is saved as data and logged.

3 0
3 years ago
Read 2 more answers
Other questions:
  • You have two LANs connected via a router. Network 1 has a DHCP server with a single Ethernet interface. Network 2 does not have
    9·2 answers
  • List THREE different types of mouse:​
    9·2 answers
  • The purpose of hazard lights is to
    7·2 answers
  • Styles are modified by using the Office clipboard in the Home tab. true or false
    5·2 answers
  • ServletConfig defines a set of methods that a servlet uses tocommunicate with its servlet container.
    5·1 answer
  • Which feature of spreadsheet software will make it easier for you to find the average number of calls made per hour for each emp
    15·1 answer
  • What is the difference between a workbook and a worksheet?
    14·2 answers
  • The lines that connect the points of a polygon are called: (1 point)
    6·2 answers
  • Drag each label to the correct location on the image.
    7·1 answer
  • Describe the differences and similarities between the most common operating systems used for Mac, PC, and Linux in
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!