Question: Consider the following code: int a = 4; int b = 6; int c = 9; int* p = &a; int* q = p;

Consider the following code: int a = 4; int b = 6; 

Consider the following code: int a = 4; int b = 6; int c = 9; int* p = &a; int* q = p; p = &b; a++; (*q) ++; b = *q* 2; c = *q + *p; What are the final values of a,b,c,p, and q?

Step by Step Solution

3.49 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Lets break down the code step by step int a 4 in... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!