In This Chapter
Seeing the need for a streams library
Using the right header files
Opening a file
Dealing with errors
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) ...