terninate called after throwing an instance of 'std::logic_error'what(): basic_string::_S_construct NULL not valid

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

错误 用法的演示:
============================
#include <string>
using namespace std;

void main(void)
{
 //string a(NULL);//错误用法
 //string b = NULL;//错误用法
 string a("");//正确用法
 string b = "";//正确用法
 string c;//正确用法

 a = "aaa";
 b = "bbbbb";
 c = "ccc";
 printf("a = %s\nb = %s\nc = %s\n",a.c_str(),b.c_str(),c.c_str());


 getchar();
}

原文地址:https://www.cnblogs.com/dongzhiquan/p/2570541.html