Sunday, August 30, 2009

Modifiers: unsigned, short and long

Integers (and in some cases characters) can be adjusted with the modifiers: unsigned, short and long. These can be used to either restrict or widen the used data type:

 unsigned int An integer value represented with as many bits as int.
range: 0 and all positives
 short int An integer value represented with at most as many bits as int.
range: negatives and positives
 long int An integer value represented with at least as many bits as int.
range: negatives and positives
 unsigned short int like short int
range: 0 and positives
 unsigned long int like long int
range: 0 and positives



it depends on the processor used with how many bits are used to represent each type.

Reference: bilmuh, msdn, faqts


Previous post

Next post


No comments:

Post a Comment