//strcpy字符串拷贝函数
char str1[] = "大忽悠";
char str2[] = "你好,世界";
strcpy(str2, str1); //'\0'也会被拷贝过去
//strcpy...(str1,str2); 会报错
//因为要将str2拷贝到str1,str2的内存大于str1的内存,所以会造成缓冲区溢出的错误
//输出字符串 要用格式符%s
printf("%s\n", str1...char buf1[32];
//遇到\0结束拷贝,所有字符串处理函数都有这个特性
strcpy(buf1, "abc\0defg");
printf("%s\n", buf1);
return...//字符数组初始化不定义长度不追加0或\0那么就会出现乱码
char c1[32] = {0};
strncpy(c1, "abcdefg", 3);
printf("%s\n", c1);...char c2[32] = { 0 };
strncpy(c2, "abc\0defg", 5); //遇到\0结束拷贝
printf("%s\n", c2);
return 0;
}