C-数据结构-typedef的用法
2024-08-27 12:27:35
.typedef的用法 # include <stdio.h> typedef int zhang; //为数据类为int从新取名为zhang 等价于int
typedef struct Student
{
int sid;
char name[];
char sex;
}ST; int main(void)
{
int i = ; //等价于 zhang i = 10;
struct Student st; //等价于 ST st;
struct Student * ps = &st; //等价于ST * ps;
zhang j = ; printf("%d\n", j); ST st2;
st2.sid = ;
printf("%d\n", st2.sid); return ;
}
.typedef的用法2 # include <stdio.h> typedef struct Student
{
int sid;
char name[];
char sex;
}* PST; //等价于struct Student * int main(void)
{
struct Student st;
PST ps = &st;
ps->sid = ;
printf("%d\n", ps->sid); return ;
}
.typedef的用法3 # include <stdio.h> typedef struct Student
{
int sid;
char name[];
char sex;
}* PSTU, STU; //等价于STU代表了 struct Student, PSTU 代表了struct Student * int main(void)
{
STU st; //等价于 struct Student st;
PSTU ps = &st; //等价于 struct Student * ps = &st;
ps->sid = ; printf("%d\n", ps->sid); return ;
}
最新文章
- C#.NET 大型通用信息化系统集成快速开发平台 4.1 版本 - 远程同步服务器大量基础数据到客户端
- 订餐系统之微信支付,踩了官方demo的坑
- What is the difference between a binary tree, a binary search tree, a B tree and a B+ tree?
- 更改SAP的字段翻译
- C# 使用js正则表达式,让文本框只能输入数字和字母,最大长度5位
- 使用RockMongo管理MongoDB
- 【原】Storm调度器
- Mysql MERGE 引擎在分表环境下得使用
- DOM注意事项(八):JavaScript操作环境和垃圾收集
- 南大算法设计与分析课程OJ答案代码(5)--割点与桥和任务调度问题
- golang channle阻塞
- openCV 备忘
- git从其他分支提取文件merge到当前分支
- openGL学习----光照
- 【Nodejs】【node.js 安装 和 配置Sublime Text的Node.js】
- C# 实现立体图形变换(vs2008)
- HTML head 头标签(转)
- GUI的最终选择Tkinter模块初级篇
- WAF Bypass数据库特性(Access探索篇)
- linux中grep用法(“或”、“与”)
热门文章
- 深度学习word embedding猜测性别初探
- php报错 【 Call to undefined function imagecreatetruecolor()】
- Keil常见错误汇总及处理方式
- Linux 小知识翻译 - 「TCP/IP」
- 软件工程实践_结对Task2_ student_department_matching
- 服务器出现大量的127.0.0.1:3306 TIME_WAIT连接 解决方法 [转载]
- XGBOOST应用及调参示例
- python中.py和.pyw文件的区别
- 查看mysql执行的线程,并杀掉他
- SpringBoot实战(十四)之整合KafKa