0
What are pointers used for and how to use them??
I am not understanding pointers how it stores the address and other assignment and increment stuff
2 Respuestas
+ 1
Pointers are variables that contain address of memory. That address usually points to the start of another variable or object. Incrementing the pointer is always done according to what it is pointing to. For example if ptr is pointer to int. And address is 0x0000 incrementing it by 1 will increase its value by 4 because thats how long int is and thats where next int would be found. 0x0004. Referencing non assigned memory will cause segfault. Meaning the operating system that is running your code will not allow it to access memory which it was not allocated. But thats whole another can of worms