memory - How do free and malloc work in C? - Stack Overflow
https://stackoverflow.com/questions/1957099/how-do-free-and-malloc-work-in-c
WEBJun 9, 2015 · How do free and malloc work in C? Asked 14 years, 3 months ago. Modified 8 years, 10 months ago. Viewed 86k times. 74. I'm trying to figure out what would happened if I try to free a pointer "from the middle" for example, look at the following code: char *ptr = (char*)malloc(10*sizeof(char)); for (char i=0 ; i<10 ; ++i) { ptr[i] = i+10; } ++ptr;
DA: 23 PA: 87 MOZ Rank: 15