1 2 3 4

随笔分类 -  C语言之字符串内容

C语言的字符串总结。。。。
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 阅读(1235) 评论(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语言之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 阅读(161) 评论(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 阅读(225) 评论(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 阅读(1231) 评论(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 阅读(249) 评论(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)

导航