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

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/18 19:07:27
terninatecalledafterthrowinganinstanceof''std::logic_error''what():basic_string::_S_constructNULLnotva

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的对象.
下面是 错误 用法的演示: