C++ types can have modifiers.
Some of the modifiers are signed and unsigned.
The signed
(the default if omitted) means the type can hold both positive and negative values.
The unsigned
means the type has unsigned representation.
Other modifiers are for the size:
We can now combine these modifiers:
#include <iostream> int main() /* w w w.j av a 2s .co m*/ { unsigned long int x = 4294967295; std::cout << "The value of an unsigned long integer variable is: " << x; }
Type int is signed by default.