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
True or false?
pishuonlain [190]

Answer: True

Explanation:

Availability is the factor that describes about the ability of authorized user to access the information ,internet service and other facilitates at any time and place. Information owner should determine and know about availability need and requirement proposed by authorized users.

  • Requirement, time, place, reason, etc are the factors that is known by owner of information for availability facility.
  • Therefore, the statement is true.
4 0
3 years ago
Which feature of the Excel window should I use to perform an action
Ne4ueva [31]
It depends on which action. 
5 0
3 years ago
1. Light of wavelength 900x10-9 m is emitted by a source. What is its frequency?​
andrezito [222]

therefore the frequency = 6×10^14

7 0
3 years ago
What are the benefits of team collaboration?
guapka [62]

Pretty simple. Ever heard of the saying 'More minds are better than one'? Well, it's true. Not only would you come up with better answers with a shared opinion, your opinions and ideas are less biased from past experiences, so they are more accurate every time!. Plus, in terms of a team collab, tasks can be completed faster if everybody focuses on different things instead of one.

:)

4 0
3 years ago
Read 2 more answers
What is the difference between - and % in mysql
jarptica [38.1K]

Answer:

Explanation:

Mysql is an open source database management system written in C and C++ language used to store, retrieve or modify a database. Mysql is used as a web database. Mysql can be combined with other programs so as to provide relational database capabilities as well as its implementation.

% matches any number of characters as well as zero characters while _ matches exactly one character.

3 0
3 years ago
Other questions:
  • What has prompted schools to add Internet activities in their academic integrity policies?
    11·2 answers
  • PLEASE HURRY
    6·1 answer
  • If you filmed a clip in 120fps, how many frames are in a seconds of video.
    13·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·2 answers
  • American company Software Unlimited is planning to expand its operations to the Bangor Republic where the group is the primary u
    7·1 answer
  • The picture that graphically represents the items you use in Windows is called a/an <br> ___?
    14·1 answer
  • when files on storage are scattered throughout different disks or different parts of a disk, what is it called
    10·1 answer
  • One key feature of malware is that it:
    13·1 answer
  • Nathaniel wanted to buy a microphone. He went to an electronics store and was told that there are actually two types of micropho
    13·2 answers
  • The quickest way to change a word is to double
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!