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
The amount of data that can be stored on a disk depends in part on_____.
MariettaO [177]
To what it seems like, it’s d
8 0
3 years ago
2 Consider the sequence of keys (5,16,22,45,2,10,18,30,50,12,1). Draw the result of inserting entries with these keys (in the gi
Juliette [100K]

Answer:

A) (2,4) tree

  • Insertion of  key 45 makes key unbalanced and this is because it violates the 2,4 tree so we split the node
  • insertion of key 10 makes key unbalanced and this is because it violates the 2,4 tree so we split the node

B) Red-black tree

Explanation:

The diagrams for the solutions are attached showing the results of inserting entries

6 0
3 years ago
Select the correct answer.
Vedmedyk [2.9K]
D because of the sun
6 0
3 years ago
A value type variable stores a _____. Group of answer choices reference class none of these value expression
andrew-mc [135]

In Computer programming, a value type variable can be used to store a: value expression.

<h3>What is a variable?</h3>

A variable can be defined as any name which refers to a location in computer memory that is typically used for storing a value.

<h3>The two types of variable.</h3>

In Computer programming, there are two (2) types of variable and these include:

  • Reference type variable
  • Value type variable

Generally, a value type variable can be used to store a <u>value expression</u> or a value of that type.

Read more on variable here: brainly.com/question/20264183

4 0
2 years ago
Which program, available on all operating systems, provides all types of information from a dns server and allows you to query a
JulsSmile [24]

The program Nslookup, is available on all operating systems and provides all types of information from a DNS server and allows you to query all types of information from a DNS server and change how your system uses DNS.

The network administration command-line tool nslookup can be used to verify that your DNS servers can resolve external domain names.

6 0
3 years ago
Other questions:
  • If you are making a 30-minute presentation, how much time should be spent summarizing your points and making any closing remarks
    11·2 answers
  • When you were configuring Encrypting File System (EFS) in the lab, a __________ on the Documents folder in the File Explorer ind
    5·1 answer
  • 15. The text of a desktop publishing document is often created using
    6·2 answers
  • Assuming that t is an array and tPtr is a pointer to that array, which expression refers to the address of element 3 of the arra
    7·1 answer
  • Where are the worksheet tabs located
    7·1 answer
  • How do you render and export files on blender
    6·1 answer
  • Select three advantages of cloud computing.
    12·1 answer
  • Which is an example of an operating system? (5 points)
    5·1 answer
  • If you do a Find and Replace for a term, where will Word begin looking for the term?
    6·1 answer
  • open your browser and enter the address of this ftp site in the address box: ftp.cengage. if your browser supports ftp, a logon
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!