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
Is a type of bullying that takes place when a person intentionally posts negative information about another that is not true
MakcuM [25]

Cyberbullying is bullying that takes place over digital devices like cell phones, ... posting, or sharing negative, harmful, false, or mean content about someone else. It can include sharing personal or private information about someone else ... as well as any negative, mean, or hurtful content

6 0
2 years ago
A method a. may have zero or more parameters b. never has parameter variables c. must have at least two parameter variables d. m
Lynna [10]

Answer:

The answer is "Option a"

Explanation:

A method is a technique, that associated with both a message and an object. It includes information, behavior, and actions of an interface defining, how the object can be used, and wrong choices can be described as follows:

  • In option b, It includes parameters in the method.
  • In option c, It contains a parameter, that may be one or more.
  • In option d, It contains one parameter also.

5 0
3 years ago
Which IDEs support multiple high-level programming languages? Select all that apply.
nata0808 [166]

Answer:

eclipse, xcode, and visual studio

6 0
2 years ago
Read 2 more answers
Does nest cam outdoor connect to a security camera prewire
yawa3891 [41]
Answer: hi there! Have a good day/night :))
6 0
2 years ago
What was the job of the Committee of Correspondence? WILL GIVE BRANLEST AND 40 POINT
Wewaii [24]

Answer:

how many of these information have you shared

5 0
2 years ago
Other questions:
  • Which is the last step in conducting a url research
    11·1 answer
  • ___ are files of related records organized according to logical systems and stored on computer-accessible media.
    5·1 answer
  • 10.
    13·1 answer
  • The part of the computer that contains the brain, or central processing unit, is also known as the A. monitor. B. keyboard. C. m
    13·2 answers
  • Indexed sequential access, an index is more useful when the number of record is
    10·1 answer
  • C++
    11·2 answers
  • Wired network are the most reliable and provide the highest speed?
    7·1 answer
  • Computer privacy typically occurs when which of the following is violated?
    6·1 answer
  • A software update is also referred to as what?
    15·2 answers
  • WILL MARK BRAINLIEST FOR ANYONES ANSWER!
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!