How much memory does a pointer variable allocate?
Only enough memory to hold the pointer itself, not any memory for the pointer to point to. 7.5a: I have a function that is supposed to return a string, but when it returns to its caller, the returned string is garbage. A: Make sure that the pointed-to memory is properly (i.e. not locally) allocated.
Related Questions
- In the HT49X30 series of devices when a "0" is written to bit 7 of the memory pointer MP, when it is read out, why does it give a value of "1"?
- When I call malloc to allocate memory for a pointer which is local to a function, do I have to explicitly free it?
- How can I save a cycle while loading the address of a Memory Mapped Register to a pointer?