Hi,
I have such code:
maybe it makes no sense but I have a similar situation in my program so I just simplified it a little bit.Code:#include <cstdio> class n { public: int *num; n do_something(n& a, n& b) { n lala=a; return lala; } n(int i =1) { num=new int[i]; } ~n() { delete[] num; } }; int main() { n a(5), b(3); n c=a.do_something(a,b); return 0; }
and I receive a warning:
a.out in free(): warning: chunk is already free
And I can't see any situation where the hell some pieace of memory is freed twice. Can anyone explain me that ?
Regards.
apacz.