Chapter 1

Filing Information with the Streams Library

In This Chapter

arrow Seeing the need for a streams library

arrow Using the right header files

arrow Opening a file

arrow Dealing with errors

arrow Working with flags to customize your file opening

First things first. We’ve all heard of rivers and lakes and streams, and it’s interesting just how many common words are used in computer programming. That’s handy, because it lets us use words we already know with similar meaning, but it’s also a bummer because it’s harder to impress strangers. While we don’t have gluggerbumbles and plickershops in computer programming — words most people have never even heard of, mainly because we made them up — we do have streams!

Most programmers think of a stream as the same thing as a file. You know — a file that’s stored on your hard drive or maybe on a Universal Serial Bus (USB) flash drive or Secure Digital (SD) card. But streams go beyond just files. A stream is any type of data structure that you stream (that is, flow) ...

Get C++ All-in-One For Dummies, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.