typedef 用户自定义的数据类型取一个新的名字
#include <stdio.h> //用户自定义的数据类型取一个新的名字 typedef int JJ; //为 int 再重新多取一个名字,JJ 等价于 int //定义一个结构体 struct Student { int sid; char name[200]; char sex; }; int main(void) { // struct Student st; // struct Student * ps = &st; int i = 10;//等价于 JJ i = 10; JJ A = 100; printf("%d\n",A); return 0; } //运行结果是 // 100 // //-------------------------------- //Process exited after 0.00711 seconds with return value 0 //请按任意键继续. . .
传播知识,分享快乐!
作者:IT_BULL
出处:http://www.cnblogs.com/itBulls/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
博客园-博客园。