42 as unsigned int is well defined as \"42U\".
unsigned int foo = 42U; // yeah!
How can I write \"23\" so that it is clear it is an
There are no modifiers for unsigned short. Integers, which has int
type by default, usually implicitly converted to target type with no problems. But if you really want to explicitly indicate type, you could write the following:
unsigned short bar = static_cast(23);
As I can see the only reason is to use such indication for proper deducing template type:
func( static_cast(23) );
But for such case more clear would be call like the following:
func( 23 );