How to check if a std::string is set or not?

前端 未结 6 757
清酒与你
清酒与你 2021-01-31 06:53

If using a char*, I can initialize it to NULL and later check if it is set by doing a comparison. How to do the same thing for a std::string

6条回答
  •  别那么骄傲
    2021-01-31 07:46

    The default constructor for std::string always returns an object that is set to a null string.

提交回复
热议问题