写了个程序有点错误,指点一下
输入a b c d 输出 d c b a#include <iostream.h>
#include<string.h>
void fun(char[]);
void main()
{
char s[80];
cout <<"请输入一个字符串:";
cin >>s;
cout <<"反序前:"<<s<<endl;
fun(s);
cout <<"反序后:"<<s<<endl;
}
void fun(char ss[])
{
for (int i=0;i<n/2;i++)
{
char c=ss[i];
ss[i]=ss[n-1-i];
ss[n-1-i]=c;
}
}
提示 for (int i=0;i<n/2;i++) 'n' : undeclared identifier