Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

C++ Basic Skills: 39 - Text Files

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
738 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 26, 2011

How to read and write text files stored on the hard drive.

  • likes, 1 dislikes

Link to this comment:

Share to:
see all

All Comments (5)

Sign In or Sign Up now to post a comment!
  • Please make more! I love this material and do put them all in one file unless it is a complete example like the time class.

  • If you forget to call .close() it will get called in the destructor so no big deal.

  • To avoid outputting garbage at the end it is better to avoid checking against .eof()

    char c;while (infile.get(c)){cout << c;}

  • Nice video...

    If people following this video want to keep adding your code examples to the same source file, they will need to close the file after each read (for example) so that things will work out correctly. If you want to keep these examples in the same source file for future reference, you'll need to close the file after each read so that the new example will work as shown in the video.

    Thanks again for the effort to make these videos! Great reviews of basic C++ concepts.

  • so smart and well made!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more