+ 1
Pointers in c++
can anyone simpley explain pointers in c++?
3 Antworten
+ 2
Think of your device memory lile a room loaded with locker storages people can use for whatever. Each locker drawer has their own identification by a number, and only a key for a particular drawer opens it.
Pointer is the key, it doesn't allow you to store anything, the drawer does. Though you need the key to open a drawer to put/get something there.
It's really an overly simpilfied illustration. Pointer itself I think, deserves a chapter in a book to get the reader understand the idea.
I would suggest you to try and search more detailed info about it on the net. Until you get better understanding about it, try to stay away from it. Learn how to use references instead 👍
+ 1
Pointer is a variable that is meant to store address of another variable.
As simple as that.
+ 1
Thank you guys.