I have a question:
I have a file named "data.inp". This file have numbers:
6 3 5 4 5
2 5 3 1
5 8 7 9
2 5 6 3 5 8 4 6
If I want more line of numbers, I will add numbers.
But I don't know how to read file "data.inp" line by line. I think I should use fgets, but seem that fgets is used for char. Or I used fgetc to read all numbers, then I count '\n' (note: "enter"), add 1, I have number of line. Then maybe I read file by that way?
thanks in advance!;)
donaldunca 0 Light Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Dave Sinkula 2,398 long time no c Team Colleague
donaldunca 0 Light Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
donaldunca 0 Light Poster
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
iamthwee
donaldunca 0 Light Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
donaldunca 0 Light Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
John A 1,896 Vampirical Lurker Team Colleague
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
donaldunca 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.