A
ahmad
Hi,
I am having trouble finding the root of this problem. My program gives
me a debugg error - I am using VC++ 6.0 - on this line delete []array,
and I would appreciate if you could provide some help.
here is the code...
Note: N=4
for(_rows=0;_rows<N;_rows++)
{
double** manor=new double*[N-1];
for(i=0;i<N;i++)
*(i+manor)=new double[N-1];
// loops to copy manor
for(rows=1;rows<N;rows++)
{
int _columns=0;
for(int columns=0;columns<N;columns++)
{
if(columns==_rows)
continue;
manor[rows-1][_columns]=m[rows][columns];
_columns++;
}
}
// code works up to this point
// Now I want to free the allocated memory
for(i=0;i<N-1;i++)
delete manor;
delete []manor; // it crashes on this line. I don't understand why?
Thanks in advance,
Ahmad
I am having trouble finding the root of this problem. My program gives
me a debugg error - I am using VC++ 6.0 - on this line delete []array,
and I would appreciate if you could provide some help.
here is the code...
Note: N=4
for(_rows=0;_rows<N;_rows++)
{
double** manor=new double*[N-1];
for(i=0;i<N;i++)
*(i+manor)=new double[N-1];
// loops to copy manor
for(rows=1;rows<N;rows++)
{
int _columns=0;
for(int columns=0;columns<N;columns++)
{
if(columns==_rows)
continue;
manor[rows-1][_columns]=m[rows][columns];
_columns++;
}
}
// code works up to this point
// Now I want to free the allocated memory
for(i=0;i<N-1;i++)
delete manor;
delete []manor; // it crashes on this line. I don't understand why?
Thanks in advance,
Ahmad