0
Memory allocation question ?
What happens when we try to allocate memory after already allocating before once like ; (1). int *ptr=malloc(12); ptr=malloc (18); Or (2). int *ptr=malloc(12); ptr=malloc (6);
2 Réponses
+ 4
It's called a memory leak.
The old data stay assigned to your program, yet they are unreachable and other programs won't be able to use that memory until your program terminates ( usually ).
https://en.wikipedia.org/wiki/Memory_leak
0
Thanks Dennis