摘要: 宏定义#define在编译预处理中起作用,行尾无需跟分号,最后跟“\”表示该行未结束,与下一行合起来。 #include,用<>,c语言标准头文件,在c系统中设置好的include文件夹;用“”,先到当前工作文件夹,再到include 结构体 struct student{ int num; cha 阅读全文
posted @ 2020-03-11 14:48 Cathycat 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 一、静态局部变量 静态变量属于静态存储方式,其存储空间为内存中的静态数据区(在静态存储区内分配存储单元),该区域中的数据在整个程序的运行期间一直占用这些存储空间(在程序整个运行期间都不释放),也可以认为是其内存地址不变,直到整个程序运行结束(相反,而auto自动变量,即动态局部变量,属于动态存储类别 阅读全文
posted @ 2020-03-11 10:49 Cathycat 阅读(799) 评论(0) 推荐(0) 编辑
摘要: 转意符打/ 可以打出“” 阅读全文
posted @ 2019-09-11 15:41 Cathycat 阅读(73) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h>#include<windows.h>#include<conio.h>int main(){ printf("请按 w s a d来控制上下左右\n"); printf("请按 p 来标雷 q来排雷\n"); char b[10 阅读全文
posted @ 2019-07-30 21:02 Cathycat 阅读(100) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h>#include<windows.h>#include<conio.h>int main (){ char a[50][50]={"######", "#o # ", "# ## #", "# # #", "## #", "### 阅读全文
posted @ 2019-07-30 19:30 Cathycat 阅读(103) 评论(0) 推荐(0) 编辑
摘要: a在前面b strcmp(a,b)<0 #include<string.h> strcpy(t,a[i]); 阅读全文
posted @ 2019-07-30 17:50 Cathycat 阅读(123) 评论(0) 推荐(0) 编辑
摘要: printf("%d",a); gets(a);读入一整行 puts(a);自动换到下一行 阅读全文
posted @ 2019-07-25 22:29 Cathycat 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>#include<conio.h> int main(){ char a; a=getche(); printf(" 你刚才输入的字母是%c",a); return 0;} a=getch(); 阅读全文
posted @ 2019-07-25 22:05 Cathycat 阅读(148) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h>int main(){ int n,i,x,j; scanf("%d",&n); int a[n]; for(i=0;i<n;i++) a[i]=0; for(i=0;i<n;i++) { scanf("%d",&x); a[x] 阅读全文
posted @ 2019-07-24 20:27 Cathycat 阅读(114) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h>int main(){ int a[10],i,n,y; n=0; for(i=0;i<10;i++) { scanf("%d",&a[i]); } scanf("%d",&y); for(i=0;i<10;i++) { if(a 阅读全文
posted @ 2019-07-24 19:56 Cathycat 阅读(86) 评论(0) 推荐(0) 编辑