+ 3
what exactly does a pointer do?
2 Respostas
+ 7
A pointer is a variable that holds an address of another variable, it helps us to point to that address whenever it's needed all along the code
+ 1
A pointer does not have to point to a variable. It can just point to *any* address in memory without having to point to a variable you allocated before. This way you can write and read in arbitrary memory. This is usually often used, if you program without an operating system. Operating systems might prevent arbitrary access to memory aka "memory access violation" on Windows or "segmentation fault" on Linux :-)