您的位置:首页 > 编程语言 > C语言/C++

C++数据类型

2016-05-11 12:51 337 查看


int main()

{

    cout<<"int:"<<sizeof(int)<<endl;

    cout<<"short:"<<sizeof(short)<<endl;

    cout<<"long:"<<sizeof(long)<<endl;

    unsigned
long a;

    cout<<"unsigned int:"<<sizeof(unsignedint)<<endl;

    cout<<"unsigned long:"<<sizeof(unsignedlong)<<endl;

    return 0;

}

无符号整型不能存储负数。

计算中中存储的是补吗,需要按位取反末位加一。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: