qq_37608631 2017-02-21 23:01 采纳率: 0%
浏览 1005

c++运算符重载++内不能修改字符数组

LCR_cipher& LCR_cipher::operator++ ()
{
int Y;
int X;
char c = ' ';
for (int i = 0; i < lengthcontext; i++)
{
X = encodeLetter(context[i]);
if (X != -1)
{
Y = (a*X + c) % 29;
context[i] = encodeNumber(Y); //这里给出的提示是Exception thrown: write access violation.

this->context was 0x21112A2.

If there is a handler for this exception, the program may be safely continued.
}
}
return *this;
}

  • 写回答

1条回答 默认 最新

  • shen_wei 2017-02-22 03:26
    关注

    encodeNumber(Y);

    看你这个函数的代码是否都正确哪。。。

    评论

报告相同问题?

悬赏问题

  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀
  • ¥15 flink cdc无法实时同步mysql数据
  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组