写了一个字符转换的小程序,但是不知道哪里出错了,帮忙看一下。

#include <iostream> #include <string.h> using namespace std; void sValue(char szA); int main() { char szValue[10]={0}; cin >> szValue; sValue(szValue); return 0; } void sValue(char szA) { char arrValue[] = "abcdefg"; char *pA = arrValue; int iInfo = strlen(arrValue)-1; for (int i = iInfo; i>=0; i--) { cout << *(pA + i); } cout << szA << endl; }
这段代码的功能是将输入的字符串按反方向输出,但是现在出错了,找了一上午也没找出原因,请大家帮忙指正。