Quote:
Originally Posted by wrecked_
Instead of using fgets() within the while condition, you should use it within the brackets and use feof() for the condition.
ex:
Code:
while( fgets() )
{
// ...
}
->
Code:
while( !feof() ) // the ! is making sure it's not the end of the file
{
fgets()
// ...
}
|
That won't make a difference.
fgets() is perfectly fine to use as the condition in the loop.
@killergirl
Use
trim() after
fgets() so the new line character is removed from the end of the string.
__________________