title: segmentation fault: 11 in C code
body: <p>Why am I getting a segmentation fault with this code?</p>
  <pre><code> /* solver.h header file */
   10 struct options{
   11     unsigned int one:1, two:1, three:1, four:1, five:1, six:1, seven:1, eight:1, nine:1;
   12 };
   13 
   14 
   15 /* structure to describe a cell */
   16 struct cell{
   17     short value;
   18     struct options open_options;
   19 };
  </code></pre>
  <p>solver.c:</p>
  <pre><code>  5 #include &lt;stdio.h&gt;
    6 #include &quot;solver.h&quot;
    7 
    8 
    9 
   10 
   11 
   12 int main(){
   13         struct cell board [9][9];
   14         int i=0,j=0;
   15 
   16 
   17         for(i = 1; i&lt;10; i++)
   18                 for(j = 1; j&lt;10; j++)
   19                         (board[i][j]).value = j;
   20 
   21         for(i = 1; i&lt;10; i++){
   22                 for(j = 1; j&lt;10; j++)
   23                         printf(&quot; %d&quot;,(board[i][j]).value);
   24                 printf(&quot;\n&quot;);
   25         }
   26         return 0;
   27 }
  </code></pre>
  <p>output:</p>
  <blockquote>
  <p>1 2 3 4 5 6 7 8 9<br />
  1 2 3 4 5 6 7 8 9<br />
  1 2 3 4 5 6 7 8 9<br />
  1 2 3 4 5 6 7 8 9<br />
  1 2 3 4 5 6 7 8 9<br />
  1 2 3 4 5 6 7 8 9<br />
  1 2 3 4 5 6 7 8 9<br />
  1 2 3 4 5 6 7 8 9<br />
  1 2 3 4 5 6 7 8 9</p>
  <p>Segmentation fault: 11</p>
  </blockquote>