c++字符串反转

来源:互联网 发布:常用数据统计的软件是 编辑:程序博客网 时间:2024/06/10 01:08
int main( void )
{
     char str[]= "http://www.ok2002.com c++ programe";
char a;
int i,j;
for (i=0,j=strlen(str)-1;i<j;i++,j--)
{
a=str[i];
str[i]=str[j];
str[j]=a;
}
for (i=0;i<strlen(str);i++)
{
cout<<str[i]<<endl;

}

}