c++ 基本类型大小
2016-03-29 10:32
218 查看
#include <iostream> #include <windows.h> using namespace std; struct hehe{ char a; int b; char c; }; //c++基本类型大小 int main() { cout << "整形:" << endl; cout << sizeof(byte) << endl; //1 cout << sizeof(short) << endl; //2 cout << sizeof(int) << endl; //4 cout << sizeof(long) << endl; //4 cout << "浮点类型:" << endl; cout << sizeof(float) << endl; //4 cout << sizeof(double) << endl;//8 cout << "布尔类型:" << endl; cout << sizeof(boolean) << endl;//1 cout << "字符类型:" << endl; cout << sizeof(char) << endl;//1 cout << "结构体:" << endl; cout << sizeof(hehe) << endl;//12 getchar(); return 0; }
相关文章推荐
- C++位操作符
- 【C/C++】malloc()
- c++适配器
- 自己实验C++
- C语言(浮点精度)
- C++ ofstream和ifstream详细用法
- this指针 C++
- configure: error: C++ preprocessor "/lib/cpp" fails sanity check
- C++与Java的输入问题
- C++ # 条件编译的理解
- c的详细学习(1)C语言概述
- 2016年,C语言该怎样写
- C++中FTP上传功能(仅用系统库)
- C++学习笔记
- C语言实现整数四则运算表达式的计算
- c++上机作业测试体重是否标准并输出相关提示
- 2D武侠游戏《剑侠世界》网游单机 搭建教程说明
- C++ 深入new
- VC++ 打印类
- C++ 元编程的魔法