Question: Question 1 ( 4 points ) Consider the following C snippet running on a system with 8 - byte pointers and 8 - byte longs:

Question 1(4 points)
Consider the following C snippet running on a system with 8-byte pointers and 8-byte longs:
long A[4]={10,20,30,40};
long B[4]={50,60,70,80};
long *C[2]={&A[1], &B[2]};
long *D[2]={&A[1], &B[2]};
B[2]=*C[1];
C[1]= &A[3];
*C[0]= B[0];
The arrays C and D contains addresses. Depending on where the arrays are stored in memory the values of the addresses in C and D will vary. For example, if A is located at address 0x1000 and B at 0x2000, then D[0] could contain 0x1008 and D[1] will contain 0x2010, but these values would be different if A and B were at different locations

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!