1 2 3 4

2020年12月16日

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 阅读(157) 评论(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 阅读(212) 评论(0) 推荐(0)

2020年12月13日

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 阅读(1201) 评论(0) 推荐(0)

2020年12月10日

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 阅读(237) 评论(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 阅读(94) 评论(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 阅读(120) 评论(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 阅读(134) 评论(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 阅读(153) 评论(0) 推荐(0)

2020年12月9日

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 阅读(859) 评论(0) 推荐(0)

导航