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
Review the portion of the application above. Record any changes or corrections that need to be made and why.
crimeas [40]

Answer:

Necessary Corrections: First Name and Last Name are recorded in incorrect boxes. Scribbles on errors instead of making corrections Does not include information in the SSN or Desired Salary blank Does not list which position she is applying for Has box checked that she has worked for the company, but does not say when For education just wrote “Yes” instead of listing the high school and address Justification: All of this make the applicant appear less professional and hurt her chances of getting hired. She is not following the directions properly, and she is not asking questions so that she can accurately fill out the application.

(I got a 100% so I know its correct)

4 0
3 years ago
A new company starts up but does not have a lot of revenue for the first year. Installing anti-virus software for all the compan
Feliz [49]

WAN domain which stands for Wide Area Network and consists of the Internet and semi-private lines. The <span>RISKS are: Service provider can have a major network outage, Server can receive a DOS or DDOS attack</span> and A FTP server can allow anonymously uploaded illegal software.





7 0
3 years ago
Real GDP removes any inflation from the calculation of GDP. Why is it important to remove a general increase in prices from the
Katen [24]
<span>C. Not including inflation into the caluculation will over-estimate the GDP.</span>
8 0
4 years ago
Which of these are examples of data sources? Check all that apply.
Rama09 [41]

Answer: databases, electronic archives, online libraries, spreadsheets (B,C,E,F)

Explanation: I just took the test :)) hope u have a great day and remeber u are beautiful <3

4 0
3 years ago
Read 2 more answers
What is the difference between omr and ocr?
vfiekz [6]

The difference between omr and ocr is (The responsibility of OMR is only to tell whether a mark is present or not in a predetermined area. OCR also detects the presence of marks but its task doesn’t stop there. OCR also needs to determine what that mark is. It is usually limited to a single language to limit the possible characters and enhance the accuracy. )


5 0
3 years ago
Other questions:
  • Write a program to input money in cents from user, example 12745 and display the one dollar bills and the cents. Submit source c
    12·1 answer
  • What should you remember when using the thesaurus to replace words?
    8·2 answers
  • The 8-bit ____ field is used by source network hosts and forwarding routers to distinguished classes or priorities in ipv6 packe
    11·1 answer
  • Always follow the routine "clean up while in use and clean up before keeping it".
    6·1 answer
  • What is computer generation.<br>name that generations ​
    9·2 answers
  • Which of the following is NOT a data type in Python?<br> integer<br> decimal<br> string<br> float
    15·1 answer
  • What can the tab key do
    10·1 answer
  • when inserting a bibliography one choose from multiple ______ of bibliographies.[insert Bibliography]
    12·1 answer
  • It would be at least two decades before some of
    12·1 answer
  • Microsoft recommends when that you create passwords with upper and lowercase letters, numbers, symbols, and use at least _______
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!