delete pointer of scalar in OpenFOAM
I created dynamic arrays of scalar in openfoam like this
Code:
int num = 10; and then I want to delete the pointer of array like this Code:
delete[] myScalar; but it seems for scalar class, delete operator has not been defined. So my question is how I should delete pointer of array to prevent memory leak. |
To call delete you normally would need to allocate it using something like:
Code:
scalar *myScalar = new scalar[num]; Or does that not fix the issue? |
All times are GMT -4. The time now is 14:51. |