定义两个字符数组即两个字符串,从键盘任意输入其中一串,然后把输入的这个字符串从第2个字符(从0个开始算)开始复制到另一个字符串中。
供参考:
#include <stdio.h> #include <string.h> int main() { char str[256]={0},dst[256]={0}; gets(str); strcpy(dst,str+2); puts(dst); return 0; }