.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 ;
}

最新文章

  1. C#.NET 大型通用信息化系统集成快速开发平台 4.1 版本 - 远程同步服务器大量基础数据到客户端
  2. 订餐系统之微信支付,踩了官方demo的坑
  3. What is the difference between a binary tree, a binary search tree, a B tree and a B+ tree?
  4. 更改SAP的字段翻译
  5. C# 使用js正则表达式,让文本框只能输入数字和字母,最大长度5位
  6. 使用RockMongo管理MongoDB
  7. 【原】Storm调度器
  8. Mysql MERGE 引擎在分表环境下得使用
  9. DOM注意事项(八):JavaScript操作环境和垃圾收集
  10. 南大算法设计与分析课程OJ答案代码(5)--割点与桥和任务调度问题
  11. golang channle阻塞
  12. openCV 备忘
  13. git从其他分支提取文件merge到当前分支
  14. openGL学习----光照
  15. 【Nodejs】【node.js 安装 和 配置Sublime Text的Node.js】
  16. C# 实现立体图形变换(vs2008)
  17. HTML head 头标签(转)
  18. GUI的最终选择Tkinter模块初级篇
  19. WAF Bypass数据库特性(Access探索篇)
  20. linux中grep用法(“或”、“与”)

热门文章

  1. 深度学习word embedding猜测性别初探
  2. php报错 【 Call to undefined function imagecreatetruecolor()】
  3. Keil常见错误汇总及处理方式
  4. Linux 小知识翻译 - 「TCP/IP」
  5. 软件工程实践_结对Task2_ student_department_matching
  6. 服务器出现大量的127.0.0.1:3306 TIME_WAIT连接 解决方法 [转载]
  7. XGBOOST应用及调参示例
  8. python中.py和.pyw文件的区别
  9. 查看mysql执行的线程,并杀掉他
  10. SpringBoot实战(十四)之整合KafKa