Changes

Jump to: navigation, search

Objective-C 2.0 Data Types

1 byte added, 15:26, 5 October 2009
= signed / unsigned
</pre>
=== signed / unsigned ===
By default, an integer is assumed to be signed. In other words the compiler assumes that an integer variable will be called upon to store either an negative or positive number. This limits the extent that the range can reach in either direction. For example, a 32-bit ''int'' has a range of 4,294,967,295. In practice, because the value could be positive or negative the range is actually −2,147,483,648 to +2,147,483,647. If we know that a variable will never be called upon to store a negative value, we can declare it as unsigned, thereby extending the (positive) range to 0 to +4,294,967,295. An unsigned int is specified as follows:

Navigation menu