For each of the following, write C++ statements that perform the specified task. Assume the unsigned integer array will be located at 1002500 in memory when the array is declared. An unsigned integer occupies four bytes. The data type of unsigned integer is unsigned. Use the constant integer variable size that is initialized to value 5 to represent the size of the array. The very first element of the array is the 0th element.

Respuesta :

Answer:

The answer is given as below.

Explanation

As the complete question is not given, the complete question is found online and is attached here with.

a)

int values[SIZE] = {2,4,6,8,10};

b)

int *aPtr;

c)

for(i=0;i<SIZE;i++)

printf("%d", values[i]);

d)

aPtr=values;

aPtr=&values[0];

e)

for(i=0;i<SIZE;i++)

printf("%d", *(aPtr+i));

f)

for(i=0;i<SIZE;i++)

printf("%d", *(values+i));

g)

for(i=0;i<SIZE;i++)

printf("%d\n", aPtr[i]);

h)

array subscript notation: values[3]

pointer/offset notation: *(values +3)

pointer subscript notation: aPtr[3]

pointer/offset notation: *(aPtr + 3)

i)

1002512 is the address is referenced by aPtr + 3 and 8 is the value stored at that location.

j)

1002500 is the address referenced by aPtr -= 2 and 2 is stored at that location.

Ver imagen danialamin
ACCESS MORE