0
question regarding pointer
int a; int *ptr; ptr=&a; cout<<"&a"; 2nd program int a ; cout<<"&a"; are these 2 program same?
1 Respuesta
+ 2
The output will be the same.
They both output the string: &a
If you want to output the memory address of a, do not use double quotes in the cout:
cout << &a;
Double quotes create a string literal.