title: Issues printing char array after reading from File
body: <p>The array var[i] reads the names of all drives from the log.txt and prints it on the screen. After that, the array is printed again until the '\0' is reached only the first character is printed.Dont know why?  </p>
  
  <pre><code>FILE *fp;
  char  var[512];
  i = 0;
  
  if (fp = fopen("log.txt", "r+")) {
      while (fscanf(fp, "%c", &amp;var[i]) != EOF) {
          printf("%c", var[i]);    -----------&gt; Works Fine
          i++;
      }
  }
  
  fclose(fp);
  printf("\n\n");
  
  i = 0;
  while(var[i] != '\0') {
      printf("%c",var[i]);        ------------------&gt; Problem
      i++;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>■N a m e
   C :
   D :
   E :
   F :
   G :
  
  
    ■N         -------------&gt; Problem
  </code></pre>