I have this nested loops working but I am printing extra char at the end because I don't know how to terminate the null char in 2D array. Here is the code:
char arr[100];
char twoDArray[100][100];
int y = 0, x = 0, h= 10, w = 10,j=0;
for(y = 0; y <= h; y++)
{
for(x = 0; x <= w; x++)
{
twoDArray[y][x] = arr[j];
printf("%c", twoDArray[y][x]);
j++;
}
}