sizeof
来源:互联网 发布:python 进程间通信 编辑:程序博客网 时间:2024/04/28 10:17
char 1
int、float 4
double 8指针 4
数组 看大小
char a[2];cout<<sizeof(a);//2,1*2int b[2] ;cout<<sizeof(b);//8,4*2
4.结构体
与精度最高的对齐
//sizeof(test)=2 struct test{ char a; char b;};//最高为sizeof(int)=4,sizeof(test)=8(6->8) struct test{ char a; char b; int c;};//最高位sizeof(double)=8,izeof(test)=16(6->16) struct test{ char a; char b; double c;};//sizeof(test)=8(6->8) struct test{ char a; char b; char* p;};
阅读全文
0 0
- SIZEOF
- Sizeof
- sizeof
- sizeof
- sizeof
- sizeof
- sizeof
- sizeof............
- sizeof
- sizeof
- sizeof
- sizeof
- sizeof
- sizeof
- sizeof
- sizeof
- sizeof
- sizeof
- 多进程 or 多线程
- HTML调用QQ临时会话
- c#学习入门笔记(曾1-30课)
- 最简单HTTPS配置
- Java并发编程艺术 4 Java并发编程基础
- sizeof
- How to Install IPython,IPython notebook and Anaconda
- Uva11178计算几何
- mtk 新sensor框架
- 动态规划--小明通过考试
- MySql 5.7.19 源代码安装 for ubuntu 16.04
- 设计模式-抽象工厂模式
- IO多路复用之select、poll、epoll详解
- 一些关于进程调度的小点总结