Raised This Month: $ Target: $400
 0% 

Reading from a file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-28-2011 , 11:41   Re: Reading from a file
Reply With Quote #2

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()     // ... }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode