在使用strcmp时的错误:0xC0000005: 读取位置 0xFEFEFEFE 时发生访问冲突。

主函数中
cout << "\t请输入账户名:";
cin >> ac;
cout << "\t请输入密码:";
cin >> pw;
if (checkac(ac, pw))
break;
n++;

//验证用户名和密码
bool checkcode(char ac[], char pw[])
{
char tempac[20], temppw[20];
if ((strcmp(ac, decrypt(number, tempac)) == 0) && (strcmp(pw,
decrypt(name, temppw)) == 0)) //就是在这里报错的
return true;
else
return false;
}
其中
//字符串解密函数
char* decrypt(char* str, char temp)
{
strcpy_s(temp,S , str);
char
p = temp;
int i = 0;
while (*p != '\0')
*p++ ^= i++;
return temp;
}

strcpy_s(temp,S , str); S在哪里定义的

char temp,return temp;,而返回类型又是char*,到底是什么