Pointer And Adress | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

3rd Feb 2017, 3:44 AM
AmierAiman 47
AmierAiman 47 - avatar
1 Answer
+ 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
3rd Feb 2017, 4:45 AM
Hatsy Rei
Hatsy Rei - avatar