Initializing 2D array and passing it in function

We had learnt to initialize 2D array like this:

int a[100][100] = {0};

int rows,cols;
cin>>rows>>cols;

for (int i=0; i<rows; i++){
	for (int j=0; j<cols; j++){
		cin>>a[rows][cols];
	}
}

But in this video of finding max sum submatrix, they have used something like this:

int main(int argc, char const *argv[]){

int n,m;
cin>>n>>m;
int **arr = new int*[n];
for (int i=0; i<n; i++){
	arr[i] = new int[m];
}
for (int i=0; i<n; i++){
	for (int j=0; j<n; j++){
	cin>>arr[i][j];
	}
}

}

My question:

  1. why is argc, char const* argv passed in main function? What does it mean?
  2. why is array defined as int **arr = new int *[n]
  3. what is the significance of for loop after the int **arr line?
  4. in the second for loop, why is " j<n " (and not m), when m is the number of colums?

Can you please help with the above?

  1. Those are not necessary. You can find your answer here https://www.tutorialspoint.com/What-does-int-argc-char-argv-mean-in-C-Cplusplus

  2. This is called Dynamic Memory Allocation( memory allocation at run time). A 2d array can be dynamically allocated memory using that code.

  3. Same as 2. To Dynamically allocate a 2d array. Refer this link https://stackoverflow.com/questions/936687/how-do-i-declare-a-2d-array-in-c-using-new

  4. Yes that must be m.