Hi all I have an exam that involves c++ coming up and I am just struggling on pointers a little, can anyone assist,
this is an example question
What will be printed out on execution and p starts with address 0x00C0
float p = 11.0;
p = p + 2.0;
float *q = &p;
float *r = q;
*r = *r + 1;
int *s = new int();
*s = *q;
*q = (*q)*10.0;
*r = 15.0;
cout << p <<endl;
cout << *q <<endl;
cout << r <<endl;
cout << *s <<endl;
cout << *r <<endl;
now I compiled and ran this program but I cant get my head around the values of *q which = 15. Does it not get multiplied by 10?
Also r is an address in memory can anyone explain that to me please?
Help appriciated!