结构的存储分配(c和指针.P206.)
来源:互联网 发布:php打包文件夹 zip 编辑:程序博客网 时间:2024/05/23 00:05
#include<stdio.h>
#include<stddef.h>
int main()
{
struct ALIGN
{
char a;
int b;
char c;
};
struct ALIGN1
{
int b;
char a;
char c;
};
printf(" sizeof(struct ALIGN) =%d\n",sizeof(struct ALIGN) );
printf("offsetof(struct ALIGN, a) = %d\n", offsetof(struct ALIGN, a));
printf("offsetof(struct ALIGN, b) = %d\n", offsetof(struct ALIGN, b));
printf("offsetof(struct ALIGN, c) = %d\n", offsetof(struct ALIGN, c));
printf(" sizeof(struct ALIGN1) =%d\n",sizeof(struct ALIGN1) );
printf("offsetof(struct ALIGN1, b) = %d\n", offsetof(struct ALIGN1, b));
printf("offsetof(struct ALIGN1, a) = %d\n", offsetof(struct ALIGN1, a));
printf("offsetof(struct ALIGN1, c) = %d\n", offsetof(struct ALIGN1, c));
getchar();
return 0;
}- 结构的存储分配(c和指针.P206.)
- 【C/C++】结构的存储分配
- C/C++结构体的存储分配
- C中结构体的存储分配
- C中结构体的存储分配
- C中结构体的存储分配
- C中结构体的存储分配
- c语言结构的存储分配小结
- 结构的存储分配
- 指针和引用是否分配存储单元的简易理解
- 结构的存储分配,对齐
- 结构体的存储分配
- 结构体的自引用和存储分配
- C和指针之结构体大小和成员变量位置距离结构开始存储的位置偏移字节
- C/C++中结构体变量及指向结构体指针变量的内存分配问题
- 第十章 结构和联合 第十一章 动态内存分配[c和指针]
- Nandflash存储结构和地址分配
- C语言指针的内存分配和Java中的引用
- C标准程序库头文件
- MySQL数据库主从同步的配置
- android基础
- 在一个java论坛解决一个打开JSP出现下载的问题
- Linux命令行技巧
- 结构的存储分配(c和指针.P206.)
- mysql查询大量数据,php内存占用溢出问题
- 高手讲解PHP引用&符号
- Java编程中“为了性能”尽量要做到的一些地方
- MYSQL启动后报:ERROR! The server quit without updating PID file错误
- android之uses-permission
- Debug Tips
- 《java第十周实验报告2-1》---人,员工继承练习
- Makefile 参数