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

在网上看到的

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM