Chapter 4

Storing Data in C++

IN THIS CHAPTER

check Using storage bins called variables

check Working with integer and character variables

check Manipulating strings

check Using Boolean variables and conditional operators

check Reading from the console

Everyone loves to store things away. The closet is a perfect example of a place to store things. You may have boxes in your closets that you haven’t opened in years. Perhaps you inadvertently created a time capsule. Or just a fire hazard. When you program a computer, you can also store things away. Most people know that a computer has two kinds of memory: memory inside a chip and memory on a hard drive. But most people use the term memory in reference to chip memory; the other is referred to as simply the hard drive. When you type a business letter in a word processor, the letter is stored in memory. After you choose File  ⇒  Save, the letter gets stored on the hard drive, but as long as you still have the letter open in the word processor, it’s generally still ...

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.