How to avoid the error: terminate called after thr

2019-02-04 12:17发布

问题:

if(player!=NULL)
    player->shuffled();

I do such things to avoid passing a null reference to a string constructor, but when compiling it still comes to error.

回答1:

Somewhere, somehow, you're calling the std::string constructor with the const char* value NULL.

To avoid the problem. Don't do that.



标签: c++ libstdc++