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

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/09 04:51:19
terninate called after throwing an instance of 'std::logic_error'what():basic_string::_S_construct NULL not validAborted程序编译没问题,运行的时候提示这个,1

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

terninate called after throwing an instance of 'std::logic_error'what():basic_string::_S_construct NULL not validAborted程序编译没问题,运行的时候提示这个,1
错误信息为:
一个实例化的逻辑错误导致程序中止.
在what()函数中不能使用NULL来构造basic_string的对象.
下面是 错误 用法的演示: