dest = (char * )malloc(len+1); //申请空间要比字符串长度大1个字节,这个字节存储字符串结束符char * s = &src[len-1]; //或者 char *s = src + len -1;另外printf前,dest[len] = 0;不然字符串没有结束符