I initialized my array like this:
char x[]={'m'};
It worked. But for the following lines i got error:Size of the type is unknown or zero
char x[][]={{'m'},{'m'}};
or
char x[][]={{'m'}};
I am unable to find the reason of the error.
For row major architecture, you should specify at least the number of columns. Why? Because, when you assign the values, the compiler has no idea how to assign them in the 2D array.
So, as others have already said, try this:
char x[][1]={{'m'}};
or
char x[1][1]={{'m'}}; // note: specifying the number of rows is redundant
In c you must specify the right most array size, so putting
char x[][1];
would work