内置类型的最大值宏定义

本文地址: http://blog.csdn.net/caroline_wendy/article/details/24311895

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*

C++ - 内置类型的最大值宏定义的更多相关文章

  1. C++内联函数与宏定义

    用内联取代宏: 1.内联可调试: 2.可进行类型安全检查或自动类型转换: 3.可访问成员变量. 另外,定义在类声明中的成员函数自动转化为内联函数. 文章(一) 内联函数与宏定义 在C中,常用预处理语句 ...

  2. C++内联函数、宏定义和普通函数的区别

    C++内联函数.宏定义和普通函数的区别? 宏定义:在预处理阶段进行简单的文本替换,不会进行参数类型检查: 内联函数:在编译器的时候进行代码插入,编译器会在每次调用内联函数的地方直接将内联函数的内容展开 ...

  3. 转-C++内联函数与宏定义区别

    主要区别: 1.内联函数在编译时展开,而宏在预编译时展开. 2.在编译的时候,内联函数直接被嵌入到目标代码中去,而宏只是一个简单的文本替换. 3.内联函数可以进行诸如类型安全检查.语句是否正确等编译功 ...

  4. 读书笔记 effective c++ Item 2 尽量使用const,枚举(enums),内联(inlines),不要使用宏定义(define)

    这个条目叫做,尽量使用编译器而不要使用预处理器更好.#define并没有当作语言本身的一部分. 例如下面的例子: #define ASPECT_RATIO 1.653 符号名称永远不会被编译器看到.它 ...

  5. C++中的内联函数和C中的宏定义的区别

    在C++中内联函数: 内联函数即是在函数的声明和和定义前面加上“inline”关键字,内联函数和常规函数一样,都是按照值来传递参数的,如果参数为表达式,如4.5+7.5,则函数将传递表达式的值(这里为 ...

  6. C++程序设计基础(4)宏定义和内联

    1.知识点 1.1宏定义 (1)不带参数的宏定义 #define ERROR_MESSAGE -100 #define SECONDS_PER_DAY 60*60*60 (2)带参数宏定义,这种形式称 ...

  7. 【C++】内联函数(inline)和宏定义(# define)的优劣及其区别

    一.宏定义:# define 1.为什么要使用宏? 因为调用宏比调用函数更有效率,函数的调用必须要将程序的执行顺序转移到函数所存放的内存地址中,将函数程序内容执行完后,再返回到执行该函数前的地方,这种 ...

  8. JDStatusBarNotification和一些宏定义

    // //  AddTopicViewController.m //  vMeet2 // //  Created by 张源海 on 16/6/30. //  Copyright © 2016年 h ...

  9. (转载)内联函数inline和宏定义

    (转载)http://blog.csdn.net/chdhust/article/details/8036233 内联函数inline和宏定义   内联函数的优越性: 一:inline定义的类的内联函 ...

随机推荐

  1. python(abi) RPM DEB Download

    python(abi) RPM DEB Download python(abi) RPM DEB Download

  2. BZOJ 1176([Balkan2007]Mokia-CDQ分治-分治询问)

    1176: [Balkan2007]Mokia Time Limit: 30 Sec   Memory Limit: 162 MB Submit: 185   Solved: 94 [ Submit] ...

  3. SynchronousQueue、LinkedBlockingQueue、ArrayBlockingQueue性能测试

    SynchronousQueue.LinkedBlockingQueue.ArrayBlockingQueue性能测试 JDK6对SynchronousQueue做了性能优化,避免对竞争资源加锁,所以 ...

  4. Django URL 命名空间

    https://docs.djangoproject.com/en/1.5/topics/http/urls/#introduction 译文: URL 命名空间 简介: 当你需要部署一个应用的多个实 ...

  5. 2 WAN 和1 Evo/3g Routeros PCC 方法负载平衡

    陕西中际现代包装科技:Routeros  2 WAN 和1 Evo/3g PCC 方法负载平衡 (Routeros多线负载平衡) 我们将要讨论2Wan和1个Evo/3G 的负载平衡.负载平衡就是在不同 ...

  6. Cocos2d-x 2地图步行实现:SPFA算法

    本文乃Siliphen原创,转载请注明出处:http://blog.csdn.net/stevenkylelee 上一节<Cocos2d-x 地图行走的实现1:图论与Dijkstra算法> ...

  7. JS正则验证邮箱的格式

    一.相关的代码  1  function test()  2         {  3            var temp = document.getElementById("text ...

  8. 动态接口服务 webservice

    private void GetDll() { WebClient client = new WebClient(); string url = "http://xxxx/services/ ...

  9. 字符串拼接 拆分 NameValueCollection qscoll = HttpUtility.ParseQueryString(result)

    string result = "sms&stat=100&message=发送成功"; string d = HttpUtility.ParseQueryStri ...

  10. 两个实验操作系统-ubuntu在安装配置pintos

    安前两次莫名其妙, 蛋疼的实验操作系统.. 首先下错了总结第一次. 使用最后gdb调试pintos什么时候, 这个错误将被报告: bochsrc.txt:8: Bochs is not compile ...