@Sevk
你要说memcpy(b,a+strlen(a)-sizeof(b)+1,17); 他就懂了。作者: zighouse 时间: 2012-12-03 18:37
better substitute strcpy with strncpy.作者: xike2002 时间: 2012-12-03 18:40
我试了不行啊,a和b都是定义的结构体中的变量,类型为char。
这样写感觉是没有语法错误,但是执行结果的时候提示段错误。作者: zighouse 时间: 2012-12-03 18:42
sizeof(char) is 1, how can you put so much thing into a byte? think it over!作者: xike2002 时间: 2012-12-03 18:51 回复 9# zighouse
字符串可以定义它的长度吧,我定义的是char a[21] = "12345678901234567890"