I have some code generated by MATLAB Coder. It includes some variables definitions of this type:
int tmp_size[400];
These variables are not explicitly deleted before the end of the method scope.
Are the variables allocated on the heap or the stack? Is this equivalent to the following?
int* tmp_size = new int[400];
Would it be best for memory management purposes to rewrite these variables definitions with new
, like int* tmp_size = new int[400];
?
I notice that memory is allocated by my program, which is never deallocated. Can this be responsible for memory leaks?