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