I don't understand why the out put is: 98 98
When was x and y ever initialized?
int *p = &x;
int *q = 98;
int*p = *q;
cout << x << " " << y << endl;
cout << *p << " " << *q << endl;
Sorry, output is
what are you trying to get your output to be?
The output is
I just don't understand why. It's an example from my book
Last edited on
It's true the code didn't compile. Either it was a simple typing error, or the book is pretty bad.