PDA

Click to See Complete Forum and Search --> : Reading File in Borland C v3.0


Jason B
Mar 16th, 2001, 06:51 AM
HI..
I need to read a file called 'input.txt' which contains several lines, with different size lengths.. I need to be able to read the whole file and each time i get to a ; i must print the string to the screen.

for example..

the file might say something like...

Hello World; How are you all?;
Is this working fine or not? Please tell me?

(Note the last string does not require a ; at the end)

so when it reads the file i want it to display:
Hello World
How are you all?
Is this working fine or not? Please tell me?

I know this might sound alot but i'm very new to C and am stuck with what to do here.. Please help me! thanks

SteveCRM
Mar 16th, 2001, 12:55 PM
You will need to use the fstream header

for a tutorial on it check here (http://www.cprogramming.com).