How to avoid the error: terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct null not valid

后端 未结 1 1567
情话喂你
情话喂你 2020-12-25 13:24
if(player!=NULL)
    player->shuffled();

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

相关标签:
1条回答
  • 2020-12-25 13:49

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

    To avoid the problem. Don't do that.

    0 讨论(0)
提交回复
热议问题