0
Pointer And Adress
I still dont get what pointer and address mean? Can someone explane me what it mean in a simple english and an example? Thanks
1 Respuesta
+ 7
int* p; // p is pointer
int q = 1; // q is variable
cout << &q; // output address of q.
p = &q; // put the address of q inside pointer p.
cout << p; // still output address of q.
cout << *p;
// outputs "point-to" p, which points to address of q
// outputs 1