Results 1 to 2 of 2
i have the following code for printing all the first word from a file......i need to print the word from the line number given by a user...........for example if the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-01-2004 #1
- Join Date
- Jun 2004
WORDS IN A LINE
in = fopen("/root/mail/inbox/info.txt", "r");
for( i=0 ; tmp[i]!=' ' ; i++ )
- 09-01-2004 #2
Just set a counter to count up from 1 when you read the first line of the file. When it gets to three, print word from that the line then exit your loop."Time is an illusion. Lunchtime, doubly so."
~Douglas Adams, The Hitchhiker's Guide to the Galaxy