September 2001
Beginner
970 pages
23h 20m
English
C has about 40 operators, but some are used much more than others. The ones just covered are the most common, but let's add four more useful operators to the list.
You saw the sizeof operator in Chapter 3, “Data and C.” To review, the sizeof operator returns the size, in bytes, of its operand. (Recall that a C byte is defined as the size used by the char type. In the past, this has most often been 8 bits, but some character sets may use larger bytes.) The operand can be a specific data object, such as the name of a variable, or it can be a type. If it is a type, such as float, the operand must be enclosed in parentheses. The example in Listing 5.8 shows both forms.
Read now
Unlock full access