I'm struggling with debugging a big c++ program that goes out of memory after a few hours, does any of those scenarios create a memory leak ?
Scenario 1 : The use of &
(without delete
or anything like this) :
inline int testFunc(std::vector<int>& peaksArray, int& tmp) {
for (int Index : peaksArray)
{
tmp++
}
}
Scenario 2 : the use of char[]
(without delete
or anything like this) :
char debug[500];
I NEVER use in my program :
new
- delcaration with
*
delete
(maybe I should ?)
Thanks for your answers,
Regards