I am wondering how can i use the delete operator if I want to delete an array initialized like this:
int (*my_ptr)[10] = new int[3][10];
This seems invalid:
delete[][]
new int[3][10]
is simply creation of a dynamic array whose elements are themselves arrays. This is deleted in the same way as all dynamic arrays: delete[]
.