Does the unsigned keyword default to a specific data type in C++? I am trying to write a function for a class for the prototype:
unsigned Rotate(unsigned object, int count)
But I don't really get what
unsigned means. Shouldn't it be like
unsigned int or something?
From the link above:
Several of these types can be modified using the keywords signed, unsigned, short, and long. When one of these type modifiers is used by itself, a data type of int is assumed
This means that you can assume the author is using ints.
short -> signed short signed short unsigned short int -> signed int signed int unsigned int signed -> signed int unsigned -> unsigned int long -> signed long signed long unsigned long
Be careful of char:
char (is signed or unsigned depending on the implmentation) signed char unsigned char