1 2 3 4

12 2020 档案

C语言之Const修饰指针
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h> #define _CRT_SCURCE_NO_WARINGSint main(){ //const 修饰指针 int x = 10; printf("未被指针修改之前的x的值:%d \n 阅读全文

posted @ 2020-12-23 13:28 三日坊主i 阅读(216) 评论(0) 推荐(0)

C语言之万能指针
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h> #define _CRT_SCURCE_NO_WARINGSint main(){ //万用指针就是可以根据数据类型改变的指针类型 int a = 10; //指向了一个int类型的数据 阅读全文

posted @ 2020-12-23 13:17 三日坊主i 阅读(271) 评论(0) 推荐(0)

C语言之野指针
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h> #define _CRT_SCURCE_NO_WARINGSint main(){ // 野指针就是指针指向了一个空的内存地址,所以形成了一个野指针。 // 野指针和空指针的区别就是,野 阅读全文

posted @ 2020-12-23 12:55 三日坊主i 阅读(178) 评论(0) 推荐(0)

C语言之空指针
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h> #define _CRT_SCURCE_NO_WARINGSint main(){ //空指针就是指向空地址的一个指针,通常用于条件判断来使用 int *p1 = NULL; print 阅读全文

posted @ 2020-12-16 20:58 三日坊主i 阅读(475) 评论(0) 推荐(0)

C语言之指针的定义与使用
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h> #define _CRT_SCURCE_NO_WARINGSint main(int argc, char *argv[]){ int x = 10; int *p1 = &x; //被 阅读全文

posted @ 2020-12-16 17:28 三日坊主i 阅读(230) 评论(0) 推荐(0)

C语言多文件联合编程模式
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h> extern void Speaks(); //extern关键字修饰的变量和函数等,都是可以被整个项目共享调用的,所以可以使用extern函数来引入其他文件的内容,但是要把要引入的东西 阅读全文

posted @ 2020-12-16 17:08 三日坊主i 阅读(226) 评论(0) 推荐(0)

C语言之函数的定义与使用
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#define _CRT_SCURCE_NO_WARINGS void speak(){ printf("我很帅。。 \n"); // 无参数,无返回值的 阅读全文

posted @ 2020-12-16 17:01 三日坊主i 阅读(550) 评论(0) 推荐(0)

C语言之字符串转换
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h>#define _CRT_SCURCE_NO_WARINGS int main(){ char add[] = "100 a"; //当字符串中有转换的数据类型的数据的时候,可以使用ato 阅读全文

posted @ 2020-12-16 16:41 三日坊主i 阅读(1234) 评论(0) 推荐(0)

C语言之strtok函数
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h>#define _CRT_SCURCE_NO_WARINGS int main(){ char add[] = {"JingsliLiu"}; printf("未使用strtok之前: " 阅读全文

posted @ 2020-12-16 16:30 三日坊主i 阅读(235) 评论(0) 推荐(0)

C语言之strchr函数
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h>#define _CRT_SCURCE_NO_WARINGS int main(){//strchr函数就是将要查找的字符查找到之后,从查到到的地方开始,记住后面的字符。 char add 阅读全文

posted @ 2020-12-16 14:53 三日坊主i 阅读(259) 评论(0) 推荐(0)

C语言之sscanf函数
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h>#define _CRT_SCURCE_NO_WARINGS int main(){ //sscanf函数就是将字符串内的内容格式化后取出,然后装进相对的数据类型的变量中 int x=12 阅读全文

posted @ 2020-12-16 14:45 三日坊主i 阅读(160) 评论(0) 推荐(0)

C语言之sprintf函数
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h>#define _CRT_SCURCE_NO_WARINGS int main(){ // sprintf函数可以将其他类型的数据和字符类型的数据写到另一个字符串当中去,当然,必须是先字符 阅读全文

posted @ 2020-12-16 14:39 三日坊主i 阅读(223) 评论(0) 推荐(0)

C语言之strcmp函数
摘要:// strcmp函数是按照ASLL比较两个字符串是不是相等,并返回一个int类型的值。//返回值为负数==字符串1小于字符串2(按ASCLL码)//返回值为证书==字符串2小于字符串1(按ASCLL码)//返回值为0时==字符串1和字符串2相等(按ASCLL码) #include <stdio.h 阅读全文

posted @ 2020-12-13 22:18 三日坊主i 阅读(1228) 评论(0) 推荐(0)

C语言之strcat函数
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h> int main(){ char str1[] = "安徽粮食"; char str2[] = "工程职业学院"; strcat(str1, str2); // hello world 阅读全文

posted @ 2020-12-10 22:47 三日坊主i 阅读(248) 评论(0) 推荐(0)

C语言之strcpy函数
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h> int main(){ char arr1[] = "安徽粮食工程学院"; char arr2[100]; strcpy(arr2, arr1); printf("拷贝后的字符串是:%s 阅读全文

posted @ 2020-12-10 22:43 三日坊主i 阅读(99) 评论(0) 推荐(0)

C语言之strlen字符串函数
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h> int main(){ char add[20]; //输入 printf("请输入字符串的内容: \n"); gets(add); int x=strlen(add); printf( 阅读全文

posted @ 2020-12-10 22:24 三日坊主i 阅读(123) 评论(0) 推荐(0)

C语言之字符串标准输入输出
摘要:#include <stdio.h>#include <stdlib.h>#include <string.h> int main(){ char add[20]; //输入 printf("请输入字符串的内容: \n"); gets(add); //输出 printf("您输入的字符串的内容是: 阅读全文

posted @ 2020-12-10 22:11 三日坊主i 阅读(119) 评论(0) 推荐(0)

C语言之多维数组
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int add[2][3][4] = { {{1,2,3,4},{5,6,7,8},{9,10,11,12}}, {{13,14,15,16},{17,18,19,20},{21,22,23,24}} 阅读全文

posted @ 2020-12-10 22:08 三日坊主i 阅读(143) 评论(0) 推荐(0)

C语言之二维数组
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int add[3][3] = { {1,2,3},{4,5,6},{7,8,9} }; for (int x = 0; x < 3; x++) { for (int i = 0; i < 3; i+ 阅读全文

posted @ 2020-12-10 22:04 三日坊主i 阅读(154) 评论(0) 推荐(0)

C语言之sizeof函数求数组长度
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int add[] = { 1,256,12,621,62,3462,6,89999,87}; int g=sizeof(add) / sizeof(add[0]); printf("add数组的长度 阅读全文

posted @ 2020-12-09 21:38 三日坊主i 阅读(872) 评论(0) 推荐(0)

C语言数组的最值查找
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int add[] = { 1,256,12,621,62,3462,6,89999,87}; int Max=add[0]; int Mini; for (int x = 0; x < g; x++ 阅读全文

posted @ 2020-12-09 21:37 三日坊主i 阅读(223) 评论(0) 推荐(0)

C语言之数组的静态创建与遍历
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int add[] = { 1,2,51,6,16,1 }; // 静态创建1 int arr[2]; // 静态创建2 arr[0] = 12; arr[1] = 25; arr[2] = 100; 阅读全文

posted @ 2020-12-09 16:05 三日坊主i 阅读(282) 评论(0) 推荐(0)

C语言之随机数
摘要:#include <stdio.h>#include <stdlib.h>#include <time.h> int main(){ int x = 0; srand((unsigned)time(NULL)); x = rand() %10; printf("产生的随机数是:%d \n", x); 阅读全文

posted @ 2020-12-09 15:59 三日坊主i 阅读(71) 评论(0) 推荐(0)

C语言之Break函数和Continue函数
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int i=0; for (i = 1; i <= 10; i++) { if (i == 3) { break; } printf("%d\n", i); } printf(" \n"); int 阅读全文

posted @ 2020-12-09 15:55 三日坊主i 阅读(424) 评论(0) 推荐(0)

C语言之九九乘法口诀表
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int i, j; for (i = 1; i <= 9; i++) { for (j = 1; j <= i; j++) { printf("%d*%d=%d ", i, j, i * j); } 阅读全文

posted @ 2020-12-09 15:51 三日坊主i 阅读(847) 评论(0) 推荐(0)

C语言之GoTo语句
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int x = 10; goto END; x == 20;END: printf("x的值是:%d \n", x); system("pause"); return 0;} 阅读全文

posted @ 2020-12-09 15:48 三日坊主i 阅读(197) 评论(0) 推荐(0)

C语言三目运算符
摘要:#include <stdio.h>#include <stdlib.h> int main(){ int x = 4; int y = x > 10 ? 100 : 2000; printf("y的值是:%d。\n", y); system("pause"); return 0;} 阅读全文

posted @ 2020-12-09 15:45 三日坊主i 阅读(216) 评论(0) 推荐(0)

C语言For循环
摘要:#include <stdio.h>#include <stdlib.h> int main(){ for (int x = 0; x < 10; x++) { printf("第%d次循环。 \n", x); } system("pause"); return 0;} 阅读全文

posted @ 2020-12-09 15:44 三日坊主i 阅读(99) 评论(0) 推荐(0)

C语言Do……While循环
摘要:#include <stdio.h> #include <stdlib.h> int main() { int x=0; do{ x++; printf("第%d次循环。",x); }while(x<10); system("pause"); return 0; } 阅读全文

posted @ 2020-12-09 15:42 三日坊主i 阅读(174) 评论(0) 推荐(0)

C语言While循环
摘要:#include <stdio.h> #include <stdlib.h> int main() { int x=0; while(x<10){ printf("第%d次循环。 \n",x); x++; } system("pause"); return 0; } 阅读全文

posted @ 2020-12-09 15:40 三日坊主i 阅读(63) 评论(0) 推荐(0)

C语言Switch分支
摘要:#include <stdio.h> #include <stdlib.h> int main() { int x=2; switch(x){ case 1: printf("x的值是1"); break; case 2: printf("x的值是2"); break; case 3: printf 阅读全文

posted @ 2020-12-09 15:31 三日坊主i 阅读(94) 评论(0) 推荐(0)

C语言If分支
摘要:#include <stdio.h> #include <stdlib.h> int main() { int x=12; if(x>10){ printf("x的值大于10 \n"); }else if(x<10){ printf("x的值小于10\n"); } system("pause"); 阅读全文

posted @ 2020-12-09 13:12 三日坊主i 阅读(132) 评论(0) 推荐(0)

导航