Friday, 19 May 2017

memory management - c free() function question








Hi,



when i have following code:



void *ptr = malloc(100); // alloc 100 bytes
// do sth
free(ptr);


how does the free() function know how much space has to be freed?




thank you!



--



ok i have found other questions asking the same, please close - sorry

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...