以下为演示代码QAQ
#include <iostream>
#include<string.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
char a[] = "xixixixi";
char b[] = "heiheihei";
strcpy(a,b);//strcpy=string copy
//strcpy(拷贝对象,拷贝源) ;
printf("%s\n",a);
return 0;
}
切记使用拷贝函数的时候一定要引用string.h 文件,不然嘿嘿 编译器会报错提醒你的哈哈
以上都是本菜鸡的个人见解 欢迎各位大佬指点