+ 1
Can someone explain to me how pointers work?
this is my first post and pardon my English. so, I have a problem understanding pointers, I get the concept of location in memory etc. but I don't get how you implement it with (for example) C, the "*" and "&" are really confusing. please if someone could tell me how pointers work in depth and in a clear way it would be kindly accepted.
2 Respostas
+ 3
* get value inside memory address stored in pointer
& get memory address of variable
int variable = 25;
int* pointer = &variable;
*pointer==variable IS TRUE, 25=25
pointer==&variable IS TRUE, 0xab7812=0xab7812 (random memory address I made up)