1
bool **arr=new bool* [row];
for(int i=0; i<9; i++)
{
    arr[i]= new bool[column];
}

I want to delete this dynamic array because it cause a problem with my RAM.

1
  • 1
    As a side note you should probably replace 9 with row to allocate each row, not just the first 9. Commented Feb 25, 2015 at 5:43

1 Answer 1

5

You just delete in the reverse order it was allocated:

for(int i=0; i<9; i++) {
    delete [] arr[i];
}
delete[] arr;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.