User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 401,607 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,778 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.

End Of File (ifstream)

Join Date: Feb 2008
Posts: 445
Reputation: Jennifer84 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
Jennifer84 Jennifer84 is offline Offline
Posting Pro in Training

Re: End Of File (ifstream)

  #4  
May 10th, 2008
Thanks... you are right, that solved the problem
I will think about not using File too.

Originally Posted by niek_e View Post
  1. ifstream File("C:\\File1\\");
  2. std::string Line;
  3.  
  4. while( getline(File, Line, ',') )
  5. {
  6. // do stuff
  7. }
  8. // the end of the file is here

It's as simple as that

And I wouldn't use 'File' as a name because it looks to much like : FILE. Something like 'infile' would be better IMO.
Reply With Quote  
All times are GMT -4. The time now is 5:05 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC