How can I print maximum value of an unsigned integer?

后端 未结 8 626
失恋的感觉
失恋的感觉 2020-12-19 02:13

I want to print the maximum value of the unsigned integer which is of 4 bytes.

#include \"stdafx.h\"
#include \"conio.h\"

int _tmain(int argc, _TCHAR* argv[         


        
相关标签:
8条回答
  • 2020-12-19 03:06

    You should use <stdint.h> and <limits.h> then INT_MAX or whatever limit is appropriate for your type.

    0 讨论(0)
  • 2020-12-19 03:06

    printf("%u", ~0); //fills up all bits in an unsigned int with 1 and prints the value.

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