C Beginner question: Pointer arithmetic > cleaning up once you are done -


i'm getting hang of pointers. there still questions have.

is possible cause memory leaks when using pointer arithmetic because shifting actual position of pointer pointing to?

i mean, if count upwards copy string char char, need count down c "knows" pointer used point to?

thanks frank

a memory leak possible when using malloc() or similar functions , not calling free() when it's needed. free() should called pointer returned malloc(), yes if this:

int* ptr = malloc(sizeof(int)); free(ptr + 1); 

causes undefined behaviour. memory leak, maybe segmentation fault, possible.


Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -