现在的位置: 首页 > 综合 > 正文

C++学习代码–sizeof

2013年10月03日 ⁄ 综合 ⁄ 共 350字 ⁄ 字号 评论关闭

#include<iostream>

using namespace std;

int main() {
    cout << "The size of bool is: " << sizeof(bool) << endl;
    cout << "The size of char is: " << sizeof(char) << endl;
    cout << "The size of int is: " << sizeof(int) << endl;
    cout << "The size of long is: " << sizeof(long) << endl;
    cout << "The size of float is: " << sizeof(float) << endl;
    cout << "The size of double is: " << sizeof(double) << endl;
    return 0;
}

抱歉!评论已关闭.