C++最大值

C++中, 经常会使用, 某些类型的最大值, 如int的最大整数(INT_MAX), C的函数中, 包含了这些宏定义.

头文件:

#include <climits>

具体参见:

name expresses value*
CHAR_BIT Number of bits in a char object (byte) 8 or greater*
SCHAR_MIN Minimum value for an object of type signed char -127 (-27+1) or less*
SCHAR_MAX Maximum value for an object of type signed char 127 (27-1) or greater*
UCHAR_MAX Maximum value for an object of type unsigned char 255 (28-1) or greater*
CHAR_MIN Minimum value for an object of type char either SCHAR_MIN or 0
CHAR_MAX Maximum value for an object of type char either SCHAR_MAX or UCHAR_MAX
MB_LEN_MAX Maximum number of bytes in a multibyte character, for any locale 1 or greater*
SHRT_MIN Minimum value for an object of type short int -32767 (-215+1) or less*
SHRT_MAX Maximum value for an object of type short int 32767 (215-1) or greater*
USHRT_MAX Maximum value for an object of type unsigned short int 65535 (216-1) or greater*
INT_MIN Minimum value for an object of type int -32767 (-215+1) or less*
INT_MAX Maximum value for an object of type int 32767 (215-1) or greater*
UINT_MAX Maximum value for an object of type unsigned int 65535 (216-1) or greater*
LONG_MIN Minimum value for an object of type long int -2147483647 (-231+1) or less*
LONG_MAX Maximum value for an object of type long int 2147483647 (231-1) or greater*
ULONG_MAX Maximum value for an object of type unsigned long int 4294967295 (232-1) or greater*
LLONG_MIN Minimum value for an object of type long long int -9223372036854775807 (-263+1) or less*
LLONG_MAX Maximum value for an object of type long long int 9223372036854775807 (263-1) or greater*
ULLONG_MAX Maximum value for an object of type unsigned long long int 18446744073709551615 (264-1) or greater*

参考链接:https://blog.csdn.net/caroline_wendy/article/details/24311895

原文链接: https://www.cnblogs.com/chendeqiang/p/12861582.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍;

也有高质量的技术群,里面有嵌入式、搜广推等BAT大佬

    C++最大值

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/347970

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年3月2日 上午4:48
下一篇 2023年3月2日 上午4:48

相关推荐