摘要: 将两个字符串合并追加在一起, 类似于python的str1+str2 #include<stdio.h> #include<string.h> #include<stdlib.h> //字符串追加, 将两个字符串结合在一起 int main() { char str1[128] = "shunguo 阅读全文
posted @ 2022-11-13 19:40 朵朵奇fa 阅读(987) 评论(0) 推荐(0)
摘要: #include<stdio.h> //gets()读取字符串, 可以读取空格 int main() { char num[2] = "";//gets 也会造成内存污染 , 设置字符串长度是2, 但是如果长度超过了2还是会打印, 所以这样就会造成内存污染 gets(num);// ()里面的参数要 阅读全文
posted @ 2022-11-13 17:26 朵朵奇fa 阅读(388) 评论(0) 推荐(0)