0
[DUPLICATE] What do you understand by memory leaks and how can it be avoided?
5 Answers
+ 2
This post is duplicate.
https://www.sololearn.com/discuss/1200118/?ref=app
+ 2
what was the correct answer then if this post is a duplicate
+ 1
How
+ 1
Just look at the accepted answer and my answer in the linked thread.
0
A memory leak is, for example, when you create dynamic data
without deleting it.
Critical is it in a loop.
while (true ) {
int* var = new int;
//some Code with 'var'
delete var;
}