Q:

assigning values of 2d array inside a struct

I have the following error 
expected ':', ',', ';', '}' or 'attribute' before '=' token
struct arrap{
 char p[6][6] = {
    {' ',' ',' ',' ',' ',' '},
    {' ',' ',' ',' ',' ',' '},
    {' ',' ',' ',' ',' ',' '},
    {' ',' ',' ',' ',' ',' '},
    {' ',' ',' ',' ',' ',' '},
    {' ',' ',' ',' ',' ',' '}
    };
};

it seems that it doesnt work any other ways to initialize the values of the 2d array inside a structure?

A:

This is the correct way:
struct arrap {
     char p[6][6];
} a = {{{' ',' ',' ',' ',' ',' '},
        {' ',' ',' ',' ',' ',' '},
        {' ',' ',' ',' ',' ',' '},
        {' ',' ',' ',' ',' ',' '},
        {' ',' ',' ',' ',' ',' '},
        {' ',' ',' ',' ',' ',' '}
      }};

It declares the type struct arrap and declares an object a of type struct arrap with the initializers you wanted.
You cannot set default initializer values for a type in C but you can initialize an object at declaration time.

