title: C - error in initializing structure with array members
body: <p>I want to initialize a structure I've made, but I get errors and I am unable to  understand what has caused them.
  I'm working on GCC with ANSI C flag.</p>
  
  <p>If someone can help me understand what the problem is, I'll very much appreciate it!</p>
  
  <pre><code>typedef struct _inst {
     const char *name[NUM_OF_INSTRUCTIONS];
     int codes[NUM_OF_INSTRUCTIONS];
     int validParam[NUM_OF_INSTRUCTIONS];    
   } instructions;
  
  
  instructions instructionsData;
  
  instructionsData.name[] = {"mov", "cmp", "add", "sub", "not", "clr", "lea", "inc", "dec", "jmp", "bne", "red", "prn", "jsr", "rts", "stop"};
  instructionsData.codes[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
  instructionsData.validParam[] = {2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0}; 
  </code></pre>
  
  <p>and the errors I get from gcc are:</p>
  
  <pre><code>dataStructs.h:47:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
   instructionsData.name[] = {"mov", "cmp", "add", "sub", "not", "clr", "lea", "inc", "dec", "jmp", "bne", "red", "prn", "jsr", "rts", "stop"};
                   ^
  dataStructs.h:47:140: warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]
   instructionsData.name[] = {"mov", "cmp", "add", "sub", "not", "clr", "lea", "inc", "dec", "jmp", "bne", "red", "prn", "jsr", "rts", "stop"};
                                                                                                                                              ^
  dataStructs.h:48:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
   instructionsData.codes[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
                   ^
  dataStructs.h:48:82: warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]
   instructionsData.codes[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
                                                                                    ^
  dataStructs.h:49:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
   instructionsData.validParam[] = {2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0};
                   ^
  dataStructs.h:49:81: warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]
   instructionsData.validParam[] = {2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0};
  </code></pre>