printf()
is a variadic function. Its optional arguments( and only those ) get promoted according to default argument promotions( 6.5.2.2. p6 ).
Since you are asking for integers, integer promotions are applied in this case, and types you mention get promoted to int
. ( and not unsigned int
because C )
If you use "%u"
in printf(), and pass it an uint16_t
variable, then the function converts that to an int
, then to an unsigned int
( because you asked for it with %u ) and then prints it.