int
The type int is a 32-bit, signed, two's-complement number, as used in virtually every modern CPU. It will be the type that you should choose by default whenever you are going to carry out integer arithmetic.
example declaration:
int i;
range of values: –2,147,483,648 to 2,147,483,647
literals: Int literals come in any of three varieties:
-
A decimal literal, e.g., 10 or –256
-
With a leading zero, meaning an octal literal, e.g., 077777
-
With a leading 0x, meaning a hexadecimal literal, e.g., 0xA5 or 0Xa5
Uppercase or lowercase has no significance with any of the letters that can appear in integer literals. If you use octal or hexadecimal, and you provide a literal that sets the leftmost bit in the receiving number, then it represents ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access