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]
2 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]2 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
Select all statements below that are TRUE for For...Next loops. A. It is used for a fixed number of iterations. B. It is used fo
sasho [114]

Answer:

A and C

Explanation:

The for next loop is used for a fixed number of iterations which is usually indicated in the syntax. It uses a counter that increments on each iteration. The loop terminates when the counter reaches the number of initially specified iterations. It is different from a while loop which depends on a specified condition evaluating to the Boolean 'true'.

7 0
3 years ago
How do I change my keyboard's debounce time?
Zanzabum

in the control board type:

HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response\BounceTime

3 0
3 years ago
Read 2 more answers
What will be the output of the following program? Assume the user responds with a 5.
FrozenT [24]

The output will be: You owe $ 15.0

4 0
3 years ago
Which visual aid should Emil use to compare and contrast the political systems in three countries?
BaLLatris [955]
A vent diagram. It helps to outline the differences and the similarities between the three countries
5 0
3 years ago
Hi!
baherus [9]

Answer:

Radius = 14 cm = 0.00014 km

Circumference = 2πr = 2 × 22/7 × 14/100000 = 0.00088 km

As it went thousand times , distance covered = 0.00088 × 1000 = 0.88 km

8 0
3 years ago
Other questions:
  • Which view In a presentation program displays you’re slides in full screen modes ?
    8·2 answers
  • Which type of graph or chart measures
    15·2 answers
  • Your bluetooth headset is waiting for another bluetooth device to locate its signal. what is this mode known as?'
    8·1 answer
  • A technician is assigned a task to configure a new server with six hard drives. The senior administrator requested the technicia
    13·1 answer
  • Which of the following is productivity strategy for collaboration?
    6·1 answer
  • What do you do when your computer shuts down
    15·2 answers
  • Evie clicks through her presentation slides and realizes they all have transition effects coming from the same location, from th
    13·1 answer
  • Consider the relational schema below: Students(sid: integer, sname: string, major: string) Courses(cid: integer, cname: string,
    9·1 answer
  • Brainly not working for me not showing any ads or answers
    5·2 answers
  • Which of the following are drivers of machine learning growth?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!