摘要: 分三块来讲述: 1 首先://注意在C和C++里不同 在C中定义一个结构体类型要用typedef: typedef struct Student { int a; }Stu; 于是在声明变量的时候就可:Stu stu1;(如果没有typedef就必须用struct Student stu1;来声明) 这里的Stu实际上就是struct Student的别名。Stu==struct Student 另外这里也可以不写Student(于是也不能struct Student stu1;了,必须是Stu stu1;) type... 阅读全文
posted @ 2013-11-20 19:37 半夏的纪念 阅读(1291) 评论(0) 推荐(0) 编辑
摘要: 原文出自http://www.cnblogs.com/codingmylife/archive/2010/04/18/1714954.html,感谢原博主的分享!C语言中有几个基本输入函数://获取字符系列int fgetc(FILE *stream);int getc(FILE *stream);int getchar(void);//获取行系列char *fgets(char * restrict s, int n, FILE * restrict stream);char *gets(char *s);//可能导致溢出,用fgets代替之。//格式化输入系列int fscanf(FILE 阅读全文
posted @ 2013-11-17 11:21 半夏的纪念 阅读(182) 评论(4) 推荐(0) 编辑