1. ## 2d array

Hi

How can i define a 2d array without giving the size of it
i want the user to enter the size
please can somone tell me how?

Code:
```#include<stdio.h>

int main(){

int arow,acol,brow,bcol,crow,ccol;
int i,j,m,k;,
int a[arow][acol],b[brow][bcol],c[crow][ccol];  // error occur here

printf("Enter the first matrix row and column size\n");
scanf("%d%d",&arow,&acol);

printf("Enter the second matrix row and column size\n");
printf("(column size must have the same size of row size of the first matrix)\n");
scanf("%d%d",&brow,&bcol);

if(arow!=bcol)
printf("Cannot perform the multiplication\n");

else{
crow=arow;
ccol=bcol;

printf("Enter the first matrix elements\n");

for(i=0;i<arow;i++)
for(j=0;j<acol;j++)
scanf("%d",&a[i][j]);

for(i=0;i<brow;i++)
for(j=0;j<bcol;j++)
scanf("%d",&b[i][j]);

for(i=0;i<crow;i++)
for(j=0;j<ccol;j++)
for(k=0; k<acol;k++){
m=a[i][k]*b[k][j];
c[i][j]+=m;}
}
return 0; }```

2. dynamic memory using new:
Code:
```int size1, size2, i;

cout << "enter size1;
cin >> size1;
cout << "enter size2;
cin >> size2;

int ** twoDarrayOfInts;
twoDarrayOfInts = new int[size1];
for(i = 0; i < size1; ++i)
twoDarrayOfInts[i] = new int[size2];```
Then you need to know how to access each subarray and each index in the array as well as how to release the memory you have appropriated in the declaration.