N
Nick Keighley
I want [to read a] text file in this format.1 15.36 1209121 is line one, 15.36 a securities price, 120912 or I guess it should be11
is the date.I am thinking fscanf(fp,"%u%.2f%d\n",&a,&b,&c);
The \n does not help -- it almost certainly does not do what you think
it does -- and %.2f is not a valid format. Why use %u for the line
number and %d for the date?
I'd use fscanf(fp, "%u %f %lu").
replace %f with %lf maybe? And remember to check the return value of
fscanf()
<snip>