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
Demographics and psychographics influence database marketing.<br><br><br> False<br><br> True
Kamila [148]

Answer:

true is the correct answer

5 0
3 years ago
4.9 Code Practice: Question 4
hichkok12 [17]

total = 0

i = 0

while i < 10:

   temp = float(input("Enter Temperature: "))

   total += temp

   i += 1

print("Sum =", str(total))

I hope this helps!

7 0
3 years ago
What does flexibility look like within your learning? Relevancy of Flexibility: Why is this important to your students?
Yakvenalex [24]

Answer:

just look like I they legs and hope they don't pop off

7 0
3 years ago
Google is the most popular:
Dvinal [7]
Google is the most popular C) Search engine.

  Explore for erudition regarding an individual or anything at the Internet by the usage of the search engine  ---> Google.

7 0
3 years ago
Read 2 more answers
Which of the following is a unique feature of credit unions?
Alecsey [184]

A list of multiple answers is provided;

 

<span>a)      </span>Credit unions are typically owned and run by their members

<span>b)      </span>Credit unions limit membership to certain people or groups

<span>c)       </span>Credit unions offer a wide variety of banking services

<span>d)      </span>Both A & B

 

The answer is both (D) Both A & B

 

As compared to banks, credit unions are small in size and are created, owned and operated by their members or participants. They are non-for-profit financial cooperatives and are structured to serve a particular region. Thus, membership in majority of credit unions is that you have to live in the area. You may also be able to join based on other various factors like Employer and family.

6 0
3 years ago
Other questions:
  • Which loan type requires you to make loan payments while you’re attending school?
    9·1 answer
  • What runs horizontally and is identified with numbers?
    12·2 answers
  • Mobile computing has two major characteristics that differentiate it from other forms of computing. What are these two character
    8·1 answer
  • What is unique about the TODAY and NOW functions?
    15·2 answers
  • Why would a store owner want to calculate a mean
    12·1 answer
  • Malware is any malicious software installed on a computer or network without the owner’s knowledge.
    10·1 answer
  • What is a sensitive compartmented information program
    12·1 answer
  • Write a statement that slices a substring out of the string quote and puts it into a variable named selection. If given the stri
    8·1 answer
  • Q2
    7·2 answers
  • How many ways are used to insert an image from file?koi h kya​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!