void * loopmove_3(char *pstr, int steps)
{int n = strlen(pstr);//不包含\0steps %= n;//移动的步数n -= steps;if ((strlen(pstr)<1) || (steps == 0)) {return(NULL); //表示没有操作}else {char *tmp = malloc(strlen(pstr) + 1);if (NULL != tmp) {strcpy(tmp, pstr + n);*(pstr + n) = '\0';strcpy(tmp + steps, pstr);//strcpy拷贝的时候,是连'\0'一起拷贝的!strcpy(pstr, tmp);free(tmp);}else {return(NULL); //表示没有操作}}return(pstr);
}