String empty,length
//string empty
//string length
#include<iostream.h>
#include<string>
void test(const string & st)
{
if(st.empty())cout<<"Empty"<<endl;
else
cout<<"length="<<st.length()<<endl;
}
int main(int argc, char *argv[])
{
string t;
test(t);
t="alaska fox";
test(t);
return 0;
}
Comments
Post a Comment