1. 首页
  2. 编程语言
  3. PHP
  4. 关于typedef和struct对比

关于typedef和struct对比

上传者: 2020-12-17 11:23:01上传 PDF文件 28.12KB 热度 13次
为什么要提出typedef的用法,因为相对于struct 结构体使用起来更方便。下面就是他们之间的对比: struct结构体 #include"stdio.h" struct Student { int sid; char name [100]; char sex; } int main(){ struct Student st; //定义结构体变量 struct Student * ps=&st; return 0; } 2.如果是typedef typedef int A ; //为int 再重新多取一个名字
下载地址
用户评论