字符串的反转函数,比较适合在校的学生~~
char * mystrrev(char *a)
{
char *right = a; //定义正常的字符串
char *left = a; //定义反向的字符串
char ch; //定义交换变量
while (*right)
right++;
right--;
while (left < right)
{
ch = *left;
*left++ = *right;
*right-- = ch;
}
阅读(2009) | 评论(0) | 转发(0) |