Given the following code:
#include
int main()
{
int *p;
p = (int *)malloc(10 * sizeof(int));
while(1);
return 0;
}
<
By the way (in addition to Seth Carnegie said):
Using the routines in you can catch the SIGINT signal (interrupt) to handle Ctrl+C in any way, for example to clean up any important resources, not only the memory (like closing files, thus avoiding the loss of any buffered and not-yet-written content, or closing network connections gently).