Dear all,
I'm a beginner programmer in C++. Recently, I'm working on image processing thing using C++.
but I have some problem that I want to ask. Suppose I have some code as follow:
for (int i=0;i<100000;i++)
{
int * a = new int[10000];
//do something
delete [] a;
}
When I executed that code, I receive runtime error, Heap Error...
Is there anything wrong with that code, I mean, can I allocate memory and release it in the same loop?
Thanks in advance...