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

Popular posts from this blog

serial to parallel test with 74c595 and pic mcu

ဆိုလာ စနစ္ရွိ BATTERY AMPACITY အား design ထုတ္တြက္ခ်က္ၿခင္း (1) watt hour ရယူၿခင္း

INTERRUPT_ON_CHANGE_18f4550