If your going through a file line by line and need to suddenly jump to the start of the next line what is a good method to move the FILE pointer to the that next line?
icici getline() is the same as fgets() just that fgets() is a C function not a C++ function. The program is in C. marsd I should have made the fact more clear, but I'm reading in each word one at a time, not an entire line. Any given word in that sentence may invoke the action to jump to the next line. I can't assume anything about the length of the line. It may have 1 word left in it or it may have 100 words left in it all of varrying sizes. I wanted a simple method that could just reposition to the next line but I guess I'll have to just fgets() the remaining part of the sentence and continue; the loop.
>> I wanted a simple method that could just reposition to
>> the next line
if u want one and it doesn't already exist then u write it ur self... that is why ur calling ur self a programmer yes?
is this a school assignment so you have to use fgets()? if not then perhaps there is a different design altogether that would be more suitable? -There are only 10 types of people in the world, those who understand binary and those who don't-
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.