So basically im extracting data from a text file.Code:int n; double j; FILE *fp= fopen(argv,"r"); fscanf(fp,"%d",&n); printf("There are %d numbers", n);
This is the text file:
(1st line) 5
(2nd line) 4.34 23.4 18.92 -78.3 17.9.
When i attempt to print the n amount of numbers, somehow the program prints the doubles instead. Whats wrong?
It has something to do with my program attempting to read the 2nd line as ints..