title: Declaring variable in header and defining in .c
body: <p>My objetive here is to use the variables defined in templates.c in another .c file.</p>
  
  <p>I am trying to define variables of type SHIP(struct that I created) declared in the templates.h file, but i get this error (i get a similar error for the rest of the variables:</p>
  
  <pre><code>templates.c:5:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘-&gt;’ token
   SHIP* Pickaxe-&gt;bitmap={  {'0','1','1','1','0'},
                ^~
  templates.c:10:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘-&gt;’ token
   SHIP* Pickaxe-&gt;size=9;
                ^~
  </code></pre>
  
  <p>here's templates.h</p>
  
  <pre><code>typedef struct{
      char bitmap[5][5];
      int size;
  }SHIP;
  
  extern SHIP *Pickaxe;
  extern SHIP *Carrier;
  extern SHIP *Battleship;
  extern SHIP *Submarine;
  extern SHIP *Cruiser;
  extern SHIP *Destroyer;
  </code></pre>
  
  <p>and the templates.c file where im defining the variables</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include"templates.h"
  #include&lt;stdlib.h&gt;
  
  Pickaxe-&gt;bitmap={  {'0','1','1','1','0'},
                     {'1','0','1','0','1'},
                     {'0','0','1','0','0'},
                     {'0','0','1','0','0'},
                     {'0','0','1','0','0'}};
  Pickaxe-&gt;size=9;
  
  
  Carrier-&gt;bitmap={{'0','0','1','0','0'},
                   {'0','0','1','0','0'},
                   {'0','0','1','0','0'},
                   {'0','0','1','0','0'},
                   {'0','0','1','0','0'}};
  Carrier-&gt;size=5;
  
  Battleship-&gt;bitmap={{'0','0','1','0','0'},
                      {'0','0','1','0','0'},
                      {'0','0','1','0','0'},
                      {'0','0','1','0','0'},
                      {'0','0','0','0','0'}};
  Battleship-&gt;size=4;
  
  Submarine-&gt;bitmap={{'0','0','0','0','0'},
                     {'0','0','1','0','0'},
                     {'0','0','1','0','0'},
                     {'0','0','1','0','0'},
                     {'0','0','0','0','0'}};
  Submarine-&gt;size=3;
  
  Cruiser-&gt;bitmap={{'0','0','0','0','0'},
                   {'0','0','1','0','0'},
                   {'0','0','1','0','0'},
                   {'0','0','1','0','0'},
                   {'0','0','0','0','0'}};
  Cruiser-&gt;size=3;
  
  Destroyer-&gt;bitmap={{'0','0','0','0','0'},
                     {'0','0','1','0','0'},
                     {'0','0','1','0','0'},
                     {'0','0','0','0','0'},
                     {'0','0','0','0','0'}};
  Destroyer-&gt;size=2;
  </code></pre>