/* example from book "Listing a Data File" */ #include int main() { float x, y; FILE *fptr; fptr = fopen("graph.dat", "r"); if (fptr) { while ((fscanf(fptr, "%f %f", &x, &y)) != EOF) printf("%f %f\n", x, y); fclose (fptr); } else printf("File not available\n"); return 0; }