C++一些报错处理


1.applying non-zero offset to null pointer:

详细信息:
runtime error: applying non-zero offset 18446744073709551615 to null pointer (basic_string.h)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/basic_string.h:527:69

解决方案:
在函数中该返回string的地方返回了int。尤其注意是不是return "0"写成了return 0

2.无法引用默认构造函数,它的构造函数已经被删除。

解决方案:
在类中声明了没有构造函数的变量,比如unordered_set<pair<int,int>> us;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM