in this int **arr;
int r,c;
cin>>r>>c;
//create an array of row heads
arr=new int *[r];
is this new int *[r]; is a pointer array created dynmically?
Allocating 2D Dynamic Arrays
@jatinupadhyay786 yes its row of heads created dynamically in memory. you have to delete it manually too.(see the diagram that sir explained in video) hope its clear if yes dont forget to hit like and mark resolved