This book contained a number of tables, and you may not want to go searching through the entire text to find them. We've included the most useful tables here, along with a couple of new ones.
Table B.1. This list of all C operators—including a couple that were not discussed in this book—ranks them from highest precedence to the lowest.
Operator Precedence
Operators
Associativity
( ) [] - .
Left to right
! -- ++ - + * & {} (type-cast) sizeof (+, - and * are all unary, not arithmetic)
Right to left
* / %
Left to right
+ -
Left to right
<< >>
Left to right
< <= > >=
Left to right
== !=
Left to right
&
Left to right
^
Left to right
|
Left to right
&&
Left to right
||
Left to right
?:
Left to right
= += -= *= /= %=
Right to left
&= ^= |= <<= >>=
,
Left to right
Table B.2. These escape sequences have special meaning when used within strings.
Escape Characters
Character
Meaning
Backspace
f
new page
Newline
Tab
Return
'
single quotation mark
"
double quotation mark
Table B.3. These signifiers act as placeholders for specific types of values. They are used in all the *f() functions: printf(), scanf(), fprintf(), sscanf(), sprintf(), and so forth.
printf(), scanf(), etc. Signifiers
Signifier
Meaning
d
integer
f
floating point number
hd
short integer
ld
long integer
hu
unsigned short integer
u
unsigned integer
lu
unsigned long integer
lf
double
Lf
long double (not always available)
c
character
s
string
p
pointer
Table B.4. Choosing an appropriate number type affects the values a variable can store and how much memory it requires.
Number Types and Approximate Sizes
Type
Memory Usage
Range of Values
short int
2 bytes
-32,768 to 32,767
Unsigned short int
2 bytes
0 to 65,535
Int
4 bytes
-2,147,483,648 to 2,147,483,647
unsigned int
4 bytes
0 to 4,294,967,295
long int
4 bytes
-2,147,483,648 to 2,147,483,647
unsigned long int
4 bytes
0 to 4,294,967,295
long long int
8 bytes
-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
unsigned long long int
8 bytes
0 to 18,446,744,073,709,551,615
Float
4 bytes
-1e38 to +1e38
Double
8 bytes
-1e308 to +1e308
long double
8 bytes
-1e308 to +1e308
Table B.5. In several places we stated that a character is actually an integer. Here are the corresponding decimal and character values. Those through number 32 are nonprinting characters.