Can someone check if I got these correct please?? I'm pretty sure I missed almost half of these so I really need help on these. If someone can explain how to get an answer, that would be great.
a: 5
b: address of location of x (0x....)
c: address of value x (0x...)
d: address of value x (0x...)
e: 5
f: 3
g: 3
h: 6
i: 9
j: vals
k: address of vals + 1
l: address of ptrVals + 2
m: 0
n: 55
o: 55
p: 0
int x;
int *ptrX;
x = 5;
ptrX = &x;
cout << "a:" << x << endl;
cout << "b:" << &x << endl;
cout << "c:" << ptrX << endl;
cout << "d:" << &ptrX << endl;
cout << "e:" << *ptrX << endl;
int vals[3];
*vals = 3;
vals[1] = *vals + 3;
*(vals+2) = 9;
cout << "f:" << vals << endl;
cout << "g:" << vals[0] << endl;
cout << "h:" << vals[1] << endl;
cout << "i:" << vals[2] << endl;
int *ptrVals;
ptrVals = vals;
cout << "j:" << ptrVals[0] << endl;
cout << "k:" << *(vals+1) << endl;
cout << "l:" << *(ptrVals+2) << endl;
int *ptr = NULL;
cout << "m:" << ptr << endl;
const int intRate = 55;
const int *ptrRate;
ptrRate = &intRate;
cout << "n:" << intRate << endl;
*ptrRate = 66;
cout << "o:" << intRate << endl;
int * const ptrY = &x;
ptrY = &vals[0];
cout << "p:" << *ptrY << endl;
const int * const ptrZ = &intRate;
ptrZ = &vals[0];
*ptrZ = 7;