title: Reading a line using fscanf()
body: <p>I am trying to read a line from a file using fscanf():    </p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  int main()
  {
      FILE *fp;
      char c, *string[4];
      int i = 0,j[4];
      fp = fopen("boil.txt", "r");
      c = fgetc(fp);
      if(fp == NULL)
      { printf("File read error\n");
          exit(0);
      }
  
      while(c != '\n')
      {
          fscanf(fp, "%s %d ", string[i] , &amp;j[i]);
          i++;
          c = fgetc(fp);
      }
      for(i = 0; i &lt; 4; i++)
      {
          printf("%s      %d\n", string[i], j[i]);
      }
  }
  </code></pre>
  
  <p>boil.txt is as follow:    </p>
  
  <pre><code>boil 4 boilmilk 3 boilwater 5 heat 10
  </code></pre>
  
  <p>Why this program is giving Segmentation Fault?</p>