C++中empty()函数的使用

C++中empty()作为判断容器是否为空的函数;
string s;

if (s.empty())

 {

    cout << “字符串为空”;

}

else

{

    cout << "字符串不为空";

}

猜你喜欢

转载自blog.csdn.net/qq_37140815/article/details/79934704