I just wrote a piece of CPP code and I compiled it using G++ in ubuntu. When I run my code everything is fine, the code runs well and gives output but doesn\'t exit and it g
Even if you're not allocating memory directly, it happens under the hood in vector
code and you most likely corrupted some portion of memory by writing where you are not supposed to. The most likely reasons I can think of are:
Of course, I can't say for sure unless you post some relevant code. Or try using valgrind to find the source of the problem.
This means you called free
on a non valid pointer (ie: a pointer not allocated via malloc, or that you already freed).
Paste some code, else it's impossible to say why this happens.