我看不懂,有完整的程序吗
追答c++中有string类型。添加头文件
#include可用。
添加后就相当于int、float、类型一样直接传值。
# include "stdio.h"
# include "string.h"
main()
{
char str1[]="hello";
char str2[100];
char *src=str1;
char *dst=str2;
while(*src)
{
*dst++=*src++;
} }
运行不了啊
最后加一句
*dst =0;