You compile the code with extra warnings enabled, which is a very good idea.
The compiler insists that you initialize an array of arrays with an initializer with the same structure. In your case you can try it char walk[10][10] = { { 0 } };.
You might have an even more restrictive setting where the compiler indicates that not enough initializers are present. The complete initializer would be:
char walk[10][10] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
};
Or a more compact version:
char walk[10][10] = { "", "", "", "", "", "", "", "", "", "" };
But looking at your code, walk does not need an initializer at all since you set all entries right below the declaration:
#include <stdio.h>
int main() {
char walk[10][10];
for (int row = 0; row < 10; row++) {
for (int col = 0; col < 10; col++) {
walk[row][col] = '.';
printf("%c", walk[row][col]);
}
}
getchar();
return 0;
}
PS: as pmg says, your code is legal and would compile as is with the default permissive settings, but using the compiler warnings to avoid silly mistakes trumps the extra constraints. Code that compiles cleanly with high warning levels usually has fewer bugs.
Note also that you can initialize walk with a single call to memset(walk, '.', sizeof(walk)); and you could output single characters more efficiently with putchar(walk[row][col]);
char walk[10][10] = { { 0 } };?= { { 0 } };.