Difference between unsigned and unsigned int in C

后端 未结 5 1402
野趣味
野趣味 2020-11-28 11:09

Could you please make it clear what the difference is between unsigned and unsigned int? Maybe some example code would be helpful.

相关标签:
5条回答
  • 2020-11-28 11:27

    unsigned is a modifier which can apply to any integral type (char, short, int, long, etc.) but on its own it is identical to unsigned int.

    0 讨论(0)
  • 2020-11-28 11:28

    They are exactly the same thing.

    0 讨论(0)
  • 2020-11-28 11:37

    There is no difference. unsigned and unsigned int are both synonyms for the same type (the unsigned version of the int type).

    0 讨论(0)
  • 2020-11-28 11:42

    unsigned alone means unsigned int. You can also use unsigned char, etc. I have no idea what happens if you try unsigned double or unsigned float. Anybody know?

    0 讨论(0)
  • 2020-11-28 11:46

    unsigned indicates that it's unsigned int. So they are equivalent.

    0 讨论(0)
提交回复
热议问题