Chapter 2
Writing with Output Streams
IN THIS CHAPTER
Using the insertion operator
Formatting your output generally and with flags
Specifying precision and setting field widths
Ensuring data safety with locked streams
Years ago, it was possible to have a personal computer with 3,000 bytes of memory. (Yes, that’s three thousand bytes, not 3MB.) As an option, this computer came with a floppy disk drive that sat outside it. It didn’t have a hard drive. Therefore, if you didn’t have a hard drive but you wanted to use an application, you had to load the application from a floppy, type its name, and press Enter!
Nowadays, the notion of a computer without permanent storage is unthinkable. Not only do your applications appear in permanent storage in the form of files, but your applications also create files to store in permanent storage. In this chapter, you see the different ways you can write to a file in any permanent storage location: hard drive, removable device, network, online, or wherever else permanent storage is found.
Get C++ All-in-One For Dummies, 4th 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.