What does “unsigned” mean when it is in itself?

I came across some C code that has "unsigned" declaring a variable by itself, for example:

unsigned crc = 0; 

I think this is very strange, because I would expect an explicit variable type here. I am surprised that there are no warnings or compiler errors (MDK-Lite 5.12).

So, is it really, and what variable does it produce?

0
c
Dec 15 '16 at 21:19
source share
1 answer

From specification C , section 6.7.2:

- unsigned or unsigned int

The value is unsigned , if no type is specified, the default should be unsigned int . Therefore, the entry unsigned a same as unsigned int a .

+8
Dec 15 '16 at 21:20
source share



All Articles