大家帮帮帮,我找不到我的小程序错在哪里.
//用递归算法把字符串倒置.#include<iostream.h>
#include<string.h>
void reverse(char *s,char *p)
{
char t;
if(s<p)
{
t=*s;*s=*p;*p=t;
reverse(s+1,p-1);
}
}
void main()
{char *s="mypicture";
char *p;
p=s+strlen(s)-1;
cout<<*p<<endl;
cout<<s<<endl;
reverse(s,p);
cout<<s;
}