title: C, Reading double values from text file
body: <p>Hi just getting some weird outputs from trying to read the inputs as double values in C. This issue does not occur when the inputs are integers is there anyway to make it work with double?</p>
  
  <pre><code>    #include "stdafx.h"
      int main(void)
      {
          double a, b, c, d, i;
          FILE *inp;
          inp = fopen("C:\\Users\\student\\Documents\\Visual Studio2012\\Projects\\ConsoleApplication3\\test.txt", "r");
          i = fscanf(inp, "%f %f %f %f", &amp;a, &amp;b, &amp;c, &amp;d);
          while (i != EOF)
          {
              printf("a = %f &amp; %d \n", a, i);
              printf("b = %f &amp; %d \n", b, i);
              printf("c = %f &amp; %d \n", c, i);
              printf("d = %f &amp; %d \n", d, i);
              printf("%d \n", EOF);
              i = fscanf(inp, "%f %f %f %f", &amp;a, &amp;b, &amp;c, &amp;d);
          }
  
          fclose(inp);
  
  
          return 0;
      }
  </code></pre>