H
Hottejonas
I have written a program in which I declare a double array as follows
double *uMatrix;
uMatrix = new double[Nnodes*(Ntimesteps+1)];
And I make sure to free it in the last part of the main program
delete[] uMatrix;
This is the second last statement of the program, and no error occures if I
terminate with exit(0) just after this line. But if I terminate the program
with
return 0;
instead of the exit(0) statement, I get a segmentation error.
It really puzzles me. Hope you can give me a good answer
Sincerely Jonas Dahl
double *uMatrix;
uMatrix = new double[Nnodes*(Ntimesteps+1)];
And I make sure to free it in the last part of the main program
delete[] uMatrix;
This is the second last statement of the program, and no error occures if I
terminate with exit(0) just after this line. But if I terminate the program
with
return 0;
instead of the exit(0) statement, I get a segmentation error.
It really puzzles me. Hope you can give me a good answer
Sincerely Jonas Dahl