//strcpy字符串拷贝函数
char str1[] = "大忽悠";
char str2[] = "你好,世界";
strcpy(str2, str1); //'\0'也会被拷贝过去
//strcpy...char buf[32] = { 0 }; //用0初始化
strcpy(buf, "活着"); //'\0'也会被拷贝过去
printf("%s\n", buf);
//3....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;
}