+ 5
what is the C++ code doing?
int* ptr = new int(27); *ptr = 34; ... delete ptr; so 1. ptr is a pointer with a value 27 2. value at ptr is changed to 34 3. delete ptr
2 Answers
+ 2
yeee! ... I'm abit confused about this part
*ptr=34;
I thought it's changing value at ptr to 34.when I do
cout << *ptr <<endln;
the value is 8327888