terninate called after throwing an instance of 'std::logic_error'what():basic_string::_S_construct NULL not validAborted程序编译没问题,运行的时候提示这个,1

来源:学生作业学帮网 编辑:学帮网 时间:2024/06/17 22:59:48

terninate called after throwing an instance of 'std::logic_error'
what():basic_string::_S_construct NULL not valid
Aborted
程序编译没问题,运行的时候提示这个,
1

错误信息为:
一个实例化的逻辑错误导致程序中止.
在what()函数中不能使用NULL来构造basic_string的对象.
下面是 错误 用法的演示: