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
A(n) ________ server tracks who is logging on to the network as well as which services on the network are available to each user
bixtya [17]

Answer:

B

Explanation:

An authentication server server tracks who is logging on to the network as well as which services on the network are available to each user. It also does the job of providing a network service that applications can use to authenticate the credentials, that are oftentimes account names and passwords, of their users. Authentication server is also used as the basis for authorization.

4 0
2 years ago
When a piece of shiny silver jewelry gets tarnished, what has happened?
makvit [3.9K]
A
because if you leave certain metals in the rain they tarnish or rust. think about how if you leave a bike in the rain for too long it will start to rust on the metal parts
6 0
3 years ago
The top-level domain name of .com indicates that the website is
Ira Lisetskai [31]
C. commercial

is ur answer
5 0
3 years ago
Read 2 more answers
HAIIIIIII ANYONE FEELING JOLLY OR SAD
Karo-lina-s [1.5K]

Answer:

Heyy I'm feeling sad and stressed. Wbu?

Explanation:

8 0
3 years ago
Read 2 more answers
What is a "telescreen"? How is it different from the televisions we know? Is it possible to make a television that could see and
mars1129 [50]

Answer:

  1. Telescreens are devices that operate as televisions, security cameras, and microphones.
  2. A television is an electronic communication medium that allows the transmission of real-time visual images, and often sound while a telescreen is a television and security camera-like device used to keep things or people under constant surveillance, thus eliminating the chance of secret conspiracies.
  3. It could be employed in secretly investigating criminals and terrorists.
  4. It could also play a major role in politics by investigating suspicious government officials and those that plan Ill towards a nation.
  5. It would definitely be a great idea to install one of such.

Explanation:

8 0
2 years ago
Other questions:
  • For C++ (please make sure it runs properly)
    14·1 answer
  • Your assignment is to write an assembly language program which read a string and print it in uppercase. This program asks the us
    15·1 answer
  • Which statement is true about the elements of the interface of a presentation program? The status bar appears at the top of the
    14·2 answers
  • Saving a file as a new filename can be accomplished through the Save As dialog box? True<br> False
    14·1 answer
  • In order to plan George’s birthday, his father gave him a list of people who attended his birthday for the last five years. What
    8·1 answer
  • Witch of the following is a valid why a scientist might a scientific theory
    13·1 answer
  • Which of the following file formats cannot be imported using Get &amp; Transform?
    6·1 answer
  • Which of the following statements is true of San serif fonts?
    12·2 answers
  • The web design teams of a company are working on designing websites for various companies, Pick the ideas that employ proper use
    13·1 answer
  • Name at least three real-life objects that are instances of each of the following classes:
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!