博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
int max+1小于0_INT_MAX常数,C ++中的示例
阅读量:2529 次
发布时间:2019-05-11

本文共 1596 字,大约阅读时间需要 5 分钟。

int max+1小于0

C ++ INT_MAX宏常量 (C++ INT_MAX macro constant)

INT_MAX constant is a macro constant which is defied in climits header, it is used to get the maximum value of a signed int object, it returns the maximum value that a signed int object can store, which is 2147483647 (on 32 bits compiler).

INT_MAX常量是在climits标头中定义的宏常量,用于获取带符号的int对象的最大值,它返回带符号的int对象可以存储的最大值,即2147483647 (在32位编译器上)。

Note:

注意:

  • The actual value depends on the compiler architecture or library implementation.

    实际值取决于编译器体系结构或库实现。

  • We can also use <limits.h> header file instead of <climits> header as INT_MAX constant is defined in both of the libraries.

    我们也可以使用<limits.h>头文件代替<climits>头文件,因为在两个库中都定义了INT_MAX常量

Syntax of INT_MAX constant:

INT_MAX常量的语法:

INT_MAX

Example:

例:

Constant call:    cout << INT_MAX;    Output:    2147483647

C ++代码演示带有climits标头的INT_MAX常量示例 (C++ code to demonstrate example of INT_MAX constant with climits header)

// C++ code to demonstrate example of // INT_MAX constant with climits header#include
#include
using namespace std;int main(){
//prinitng the value of INT_MAX cout<<"INT_MAX: "<
<

Output

输出量

INT_MAX: 2147483647

C ++代码演示带有limits.h头文件的INT_MAX常量示例 (C++ code to demonstrate example of INT_MAX constant with limits.h header file)

// C++ code to demonstrate example of // INT_MAX constant with 
header file#include
#include
using namespace std;int main(){
//prinitng the value of INT_MAX cout<<"INT_MAX: "<
<

Output

输出量

INT_MAX: 2147483647

翻译自:

int max+1小于0

转载地址:http://nhxzd.baihongyu.com/

你可能感兴趣的文章
给构造函数(constructor)创建对象(object)
查看>>
局域网访问PHP项目网站 用IP地址进入
查看>>
VM虚拟机,Linux系统安装tools过程遇到 what is the location of the “ifconfig” program
查看>>
Jquery实现循环删除Reaper某一行
查看>>
脚本升级openssh
查看>>
linux学习(3)——vim文本编辑工具
查看>>
快速开发平台如何应用
查看>>
hadoop的理解
查看>>
Java测试当前应用所占用的内存示例
查看>>
网站限制IP访问应该怎么办
查看>>
121. Best Time to Buy and Sell Stock
查看>>
hdu 1005 根据递推公式构造矩阵 ( 矩阵快速幂)
查看>>
安装php扩展
查看>>
mysql统计某一个数据库中有几张表
查看>>
百度移动搜索主要有如下几类结果构成
查看>>
梦断代码最后4章读后感
查看>>
python学习---字符串
查看>>
Python爬虫面试题170道:2019版【1】
查看>>
JavaBean规范
查看>>
第四阶段 15_Linux tomcat安装与配置
查看>>