C++ 内置类型

 今天学了内置类型

 

#include<uchar.h>
#include <iostream>
using  std::cin;
using  std::cout;
using  std::endl;
int main()
{
    cout << "bool:" << sizeof(bool) << endl;    
    cout << "char:" << sizeof(char) << endl;
    cout << "wchar_t:" << sizeof(wchar_t) << endl;
    cout << "char16_t:" << sizeof(char16_t) << endl;
    cout << "char32_t:" << sizeof(char32_t) << endl;
    cout << "short:" << sizeof(short) << endl;
    cout << "int:" << sizeof(int) << endl;
    cout << "long:" << sizeof(long) << endl;
    cout << "long long:" << sizeof(long long) << endl;
    cout << "float:" << sizeof(float) << endl;
    cout << "double:" << sizeof(double) << endl;
    cout << "long double:" << sizeof(long double) << endl;
    return 0;
}

 

左边是VS的 右边是CB的

PS. VS里要加#include<uchar.h> 才能用char16_t、char32_t   CB就不用emmmmmmmmmmmmmm

在网上看到的

 

posted @ 2018-04-10 20:24  zgnclsy  阅读(959)  评论(1)    收藏  举报