【问题标题】:C++ multiplying BigInt - Exception thrown at 0x00007FFD777FF530 (ucrtbased.dll)C++ 乘以 BigInt - 在 0x00007FFD777FF530 (ucrtbased.dll) 处引发异常
【发布时间】:2021-06-11 03:29:10
【问题描述】:

我目前正在尝试使用这个用于 c++14 的 BitInt 库来执行更大的计算。

https://faheel.github.io/BigInt/

每当两个 BitInt 相乘时,就会出现一个错误。 我重新安装了 Visual Studio 和底层编译器,并且正在运行最新版本。

错误信息

The thread 0x2918 has exited with code 0 (0x0).
Exception thrown at 0x00007FFDA337F530 (ucrtbased.dll) in MyProg.exe: 0xC0000005: Access violation reading location 0x00007FF8A3E3A84F.

这是我的代码

#include <iostream>
#include "../BigInt/BigInt.hpp"


int main()
{
    BigInt big1, big2;
    big1 = "2";
    big2 = "9876543210123456789098765432101234567890";

    std::cout << (big1 * big2).to_string();
    // std::cout << big1 * big2 * 123456 << "\n";

    return 0;
}

截图

This is a screenshot of the file the error is in

【问题讨论】:

  • 0.5.0 版本适合我

标签: c++ bigint


【解决方案1】:

并非所有开源软件都可以正常运行。很遗憾。这看起来像是您使用的库中的一个错误。我建议在图书馆的 GitHub 存储库上发布问题。之后,如果您愿意,您还可以尝试调试库内部,进行修复并将带有修复的 PR 发布回库。否则,我建议使用更多经过时间验证的库,例如 Crypto++。

【讨论】:

  • 谢谢。我试过重写这个库,但我现在对 C++ 的经验太少了。我要看看 Crypto++。
猜你喜欢
  • 1970-01-01
  • 2017-04-12
  • 2019-04-01
  • 2018-11-26
  • 2021-02-14
  • 1970-01-01
  • 1970-01-01
  • 2016-11-12
  • 1970-01-01
相关资源
最近更新 更多