[Courses] [C] Beginner's Lesson: How do I...?

Laurel Fan laurel at sdf.lonestar.org
Fri Dec 13 11:37:24 EST 2002


On Fri, Dec 13, 2002 at 02:49:45PM -0500, KWMelvin wrote:
> Okay, the fact that this works with a string array suggests a possible
> solution: Somehow copy the file to a string array and make sure it ends
> with a NULL.  Perhaps this string array could be called a "buffer"?
> Then it might be possible to use strtok() with "\n" as the delimiter
> to get a record?

I'm not sure exactly what you want to do, but if you want to do
something to each line in a file, fgets() reads line by line. 

Or are you asking how to read input from a file in the first place?

-- 
laurel at sdf.lonestar.org
http://dreadnought.gorgorg.org



More information about the Courses mailing list