由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - is MAX_INT standard macro for getting max_int in C++
相关主题
问低级问题A function can be history-sensitive??????
macro and std:: function name clashingQuestion about
师傅们,C++概念题,弟子有礼了Question about friend in C++
这段代码为何要这样做?最初级的白痴C++问题
gcc 优化不优化运算结果不一样?gcc 的 bug?一道面试怪题C++. (转载)
经典题atoi的溢出处理 (转载)关于Makefile的一个问题
请教 一个关于loop的问题C++编译的问题
How to see the content of a library file请教有关header file的几个问题
相关话题的讨论汇总
话题: int话题: max话题: c++话题: standard话题: use
进入Programming版参与讨论
1 (共1页)
j****g
发帖数: 597
1
I'm not sure if it's a standard one or depends on compiler.
What header file should I include to use that?
t****t
发帖数: 6806
2
it's not MAX_INT
it's INT_MAX, in
but this is for C anyway.
for C++, you should use
#include
int int_max=std::numerical_limits::max();
Yes it's long, but you can use for any built-in type, thus you can use it in
template.

【在 j****g 的大作中提到】
: I'm not sure if it's a standard one or depends on compiler.
: What header file should I include to use that?

j****g
发帖数: 597
3
got it. thanks
1 (共1页)
进入Programming版参与讨论
相关主题
请教有关header file的几个问题gcc 优化不优化运算结果不一样?gcc 的 bug?
关于C++ STL编译的疑问经典题atoi的溢出处理 (转载)
不明白C++的一个地方请教 一个关于loop的问题
What does this mean in C++How to see the content of a library file
问低级问题A function can be history-sensitive??????
macro and std:: function name clashingQuestion about
师傅们,C++概念题,弟子有礼了Question about friend in C++
这段代码为何要这样做?最初级的白痴C++问题
相关话题的讨论汇总
话题: int话题: max话题: c++话题: standard话题: use