C++/C一些类型的取值范围
long long的最大值:9223372036854775807
long long的最小值:-9223372036854775808
unsigned long long的最大值:1844674407370955161
__int64的最大值:9223372036854775807
__int64的最小值:-9223372036854775808
unsigned __int64的最大值:18446744073709551615
我的电脑对__int128不支持,这个可能是预留给将来的吧:
view plaincopy to clipboardprint?
#if _INTEGRAL_MAX_BITS >= 128
#define _I128_MIN (-170141183460469231731687303715884105727i128 - 1)
#define _I128_MAX 170141183460469231731687303715884105727i128
#define _UI128_MAX 0xffffffffffffffffffffffffffffffffui128
#endif
#if <wbr> <wbr> <wbr> <wbr> _INTEGRAL_MAX_BITS >= 128
#define _I128_MIN <wbr> <wbr> (-170141183460469231731687<wbr>303715884105727i128 - 1)
#define _I128_MAX <wbr> <wbr> <wbr> <wbr> 170141183460469231731687<wbr>303715884105727i128
#define _UI128_MAX <wbr> <wbr> <wbr> <wbr>0xffffffffffffffffffffff<wbr>ffffffffffui128
#endif
搜索了一下_INTEGRAL_MAX_BITS ,找到一篇说明,都是EN文的,看意思也是预留了,哈
把链接也记下来吧:
http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00465.html
通过程序来实现查看:
view plaincopy to clipboardprint?
#include<iostream>
#include<climits>
using namespace std;
int main()
{
cout<<"long long的最大值:"<<LLONG_MAX<<endl;
cout<<"long long的最小值:"<<LLONG_MIN<<endl;
cout<<"unsigned long long的最大值:"<<UL
相关文档:
C和指针
在C中有一个很重要的概念,或许大家都知道,那就是指针。在很多初学者刚接触C的时候都认为这是最难的知识点了。没错,我刚开始学的时候也是这么想的,上了第一节课后,第一感受就是:天啊,这简直就是天书!由于个人对于C的爱好,经过一段时间的学习和研究之后,发现这一块是我最喜欢的,并且逐步发现这也是本人的 ......
在很大程度上,标准C++是标准C的超集.实际上,所有C程序也是C++程序,然而,两者之间有少量区别.下面简要介绍一下最重要的区别.
在C++中,民,局部变量可以在一个程序块内在任何地方声明,在C中,局部变量必须在程序块的开始部分,即在所有"操作"语句之前声明,请注意,C99标准中取消了这种限制.
&nb ......
C/C++
/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010年4月29日, 上午9:46
*/
#include <iostream>
using namespace std;
int maximum(int[], int);
int main(int argc, char** argv) {
// int sg[3][4] = {
int sg[][4] = {
{68, 77, 73, 86},
{87, 96, 7 ......
#include <assert.h> //设定插入点
#include <ctype.h> //字符处理
#include <errno.h> //定义错误码
#include <float.h> //浮点数处理
#include <fstream.h> //文件输入/输出
#include  ......