October 2004
Beginner
408 pages
9h 24m
English
The overwhelming majority of data you'll work with will be in the form of variables (as opposed to constants, which you'll also learn about at the end of this chapter). To use a variable, you must first declare it—in other words, you state that a variable with a specific name will be of a certain type. The declaration statement looks like this:
datatype variablename;
For example:
int age; float cost; char answer;
The different types are listed in Table 2.1, along with what version of C they are allowed in.
| C Data Types | |
|---|---|
| Type | C Standard |
| int | All |
| long int | All |
| long long int | All |
| short int | All |
| unsigned | All |
| float | All |
| double | All |
| long double | All |
| char ... | |
Read now
Unlock full access