Iterator value problem

Hi,

I am trying to compare value for iterator. Currently i manage to get the value of pdu.short_message() through cout by the iterator. But I dont know how to compare the value of the sms iterator. Here's the code, but I got error at if (sms == 'quit').


if(pdu.sm_length()){

std::ostream_iterator<char>sms(std::cout);
std::copy(pdu.short_message().begin(), pdu.short_message().end(),sms);

if (sms == 'quit'){
cout<<"quitting...."<<endl;
}
}



Need help from anyone...Thanks!
Last edited on
Strings require double quotes, single quotes are for single characters. You have single quotes around "quit" by mistake.
Topic archived. No new replies allowed.