5. Adding Variables to Your Programs

In This Chapter

Identifying kinds of variables

Naming variables

Defining variables

Storing data in variables

No doubt you’ve heard that computers process data. Somehow you’ve got to have a way to store that data. In C, as in most programming languages, you store data in variables. A variable is nothing more than a box in your computer’s memory that holds a number or a character. Chapter 2, “Writing Your First C Program,” explained the different types of data: characters, strings, integers, and floating points. This chapter explains how to store those types of data inside your programs.

Kinds of Variables

C has several different kinds of variables because there are several different kinds of data. ...

Get C Programming Absolute Beginner’s Guide, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.