c++ validate string not empty code example
Example 1: c++ check if string is empty
#include <iostream>
int main()
{
std::string str;
if(str.empty()) std::cout << "Empty";
return 0;
}
Example 2: empty string in c++
str.empty()
#include <iostream>
int main()
{
std::string str;
if(str.empty()) std::cout << "Empty";
return 0;
}
str.empty()