+ 1
cout<<p<<endl; output-0x29fee8 how?
3 odpowiedzi
+ 2
You're actually printing the memory address to which p is pointing to. If you want to print the actual value of the pointed cell just dereferentiate p: cout << *p;
0
it will print the address of the variable which the pointer holds
0
u have not initialized p so garbage value is default for auto storage class variables