Skip to main content
GameDev.net gamedev.net
🔒 Locked

Reading Text Files

Started by Galileo430 Dec 18, 2000 at 10:33 PM 4 replies 550+ views
Original Post
Galileo430
Galileo430
Does anyone know the easyist way to get a line of text from a text file with FREAD?
------------------------------------------------------------I wrote the best video game ever, then I woke up...
phueppl1
phueppl1
Why use fread() ?

use fscanf() or something similar... look in the MSDN for more infos on that..
cya,
Phil

Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states
Visit Rarebyte! and no!, there are NO kangaroos in Austria (I got this question a few times over in the states ;) )
Galileo430
Galileo430
ok, fgets puts the line in a string BUT
fscanf gives me this error when I give it the string.

  
fscanf'' : cannot convert parameter 1 from ''char [100]'' to ''struct _iobuf *''


How do you get around that?

scanf just freezes my program..
------------------------------------------------------------I wrote the best video game ever, then I woke up...
Galileo430
Galileo430
Nm, I got it...

sscanf should be used not fscanf.
------------------------------------------------------------I wrote the best video game ever, then I woke up...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.