Skip to main content
added 2 characters in body
Source Link
int **arr = new int[NoOfRows]int* [NoOfRows]
for(int i = 0; i<NoOfRows; i++)
   arr[i] = new int[noOfColumn];

This is the good way to declare the 2D array in c++ using new Here NoOfRow is showing that how many rows you want ans noOfColumn is showing how many column you want

int **arr = new int[NoOfRows]
for(int i = 0; i<NoOfRows; i++)
   arr[i] = new int[noOfColumn];

This is the good way to declare the 2D array in c++ using new Here NoOfRow is showing that how many rows you want ans noOfColumn is showing how many column you want

int **arr = new int* [NoOfRows]
for(int i = 0; i<NoOfRows; i++)
   arr[i] = new int[noOfColumn];

This is the good way to declare the 2D array in c++ using new Here NoOfRow is showing that how many rows you want ans noOfColumn is showing how many column you want

Source Link

int **arr = new int[NoOfRows]
for(int i = 0; i<NoOfRows; i++)
   arr[i] = new int[noOfColumn];

This is the good way to declare the 2D array in c++ using new Here NoOfRow is showing that how many rows you want ans noOfColumn is showing how many column you want