Read one line out of a file?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Read one line out of a file?

Post by r2d2 »

Is there a function in Irrlicht that can read just one line out of a file and not a determined amount of data?
R2D2's Irrlicht Mods
Messed up with my database so the page is not working at the moment -.-
CPU: Core 2 Quad Q6700RAM: 4096 mb Graphics: Radeon 4850 512mb Sound: on board InternetConnection: DSL
Guest

Post by Guest »

Are you talking about just pulling out a line of text one at a time?
r2d2
Posts: 211
Joined: Mon Nov 24, 2003 5:22 pm

Post by r2d2 »

i just want to read out one line check what is in that line and depending on the content i want to read different lines out
R2D2's Irrlicht Mods
Messed up with my database so the page is not working at the moment -.-
CPU: Core 2 Quad Q6700RAM: 4096 mb Graphics: Radeon 4850 512mb Sound: on board InternetConnection: DSL
VPB
Posts: 36
Joined: Sat Apr 10, 2004 8:02 am

Post by VPB »

something like:

static char arr[1024];
file.getline(arr,1024,'\n');

Then the line is storred in the array arr, u can do with that anything you like :lol:

don't forget to include: #include <fstream.h>

EDIT:
To get the file :lol:

ifstream file("file.extension");
Post Reply