+ 1
where does "0x29fee8" come from in this?
int score = 5; int *scorePtr; scorePtr = &score; cout << scorePtr << endl; //Outputs "0x29fee8
3 odpowiedzi
+ 4
scorePtr stores the address of score. 0x29fee8 is this address
+ 2
if you dont understand how ampersand and pointers work you should probably take another look at the pointers section of the c++ tutorial
+ 1
cout << scorePtr << endl;
This only shows the memory address that the value is currently stored in (0x29fee8)
If you want to show the value stored there then you need to write...
cout << *scorePtr << endl;