title: An array that represents a panel with filled and blank spaces
body: <p>I am making a program that would read the input (the coordinates of horizontal and vertical lines) like this:</p>
  
  <pre><code>struct Data {
      // the beginning and ending coordinate of a line
      int xStart;
      int xEnd;
      int yStart;
      int yEnd;
  };
  // the dimension of panel on which you draw lines
  int panelWidth, panelHeight;
  // number of lines drawn on the panel
  int numLines;
  
  scanf("%d %d", &amp;panelWidth, &amp;panelHeight);
  struct Data data[5];
  int j;
  int i;
  
  j = 0;
  if (scanf("%s", &amp;numLines) == 1)
   {
      for (i = 0 ; ((i &lt; numLines) &amp;&amp; (j &lt; 5)) ; ++i)
       {
          if (scanf("%d %d %d %d",
              &amp;data[j].xStart, 
              &amp;data[j].yStart, 
              &amp;data[j].xEnd, 
              &amp;data[j].yEnd) == 4)
           {
              j++;
           }
       }
   }
  </code></pre>
  
  <p>Now I would like to put these values in an array that would represent the panel and draw all the lines on the panel (e.g. put the value 1 where there is a line and 0 where the cells are empty), so that I can then count all the zones that these lines make (spaces with zeros). </p>
  
  <p>It should work like flood fill. </p>
  
  <p>How do I make such array? Or is there a better option? </p>
  
  <blockquote>
    <p>This is an example of a more complicated input:</p>
  </blockquote>
  
  <pre><code>27 27 // width, height
  7 // number of Lines
  10 0 10 10 // xStart, xEnd, yStart, yEnd
  0 10 10 10 // xStart, xEnd ...
  5 5 15 5
  15 5 15 15
  5 15 21 15
  5 5 5 15
  5 20 26 20
  </code></pre>