C++ examples for STL:string
Use string member-function empty
#include <iostream> #include <string> using namespace std; int main()/*from w ww . j a v a 2 s.c o m*/ { string s3; cout << "\n\nTesting s3.empty():" << endl; if (s3.empty()) { cout << "s3 is empty; " << endl; } }