B
Bill Cunningham
I want to read formatted text from a text file into a function. Would I
use fscanf or fgetc. For example, I have a text file called "num" that says
the following:
1 12.35
2 11.68
I want to read this text, stored it and pass it as parameters to other
functions. If I used fscanf I have no idea how to use the format specifiers
since I don't really use the scanf family. I usually use fgets to stdin for
input and puts for writing. But this is to a file stream. I hope I'm making
sense. Someone help me out with how reading with fscanf works. That's a new
one on me.
Bill
use fscanf or fgetc. For example, I have a text file called "num" that says
the following:
1 12.35
2 11.68
I want to read this text, stored it and pass it as parameters to other
functions. If I used fscanf I have no idea how to use the format specifiers
since I don't really use the scanf family. I usually use fgets to stdin for
input and puts for writing. But this is to a file stream. I hope I'm making
sense. Someone help me out with how reading with fscanf works. That's a new
one on me.
Bill