cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Iterator value problem
Iterator value problem
Apr 2, 2013 at 6:06am UTC
Wani Radzi
(1)
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
Apr 2, 2013 at 6:06am UTC
Apr 2, 2013 at 2:41pm UTC
LB
(13399)
Strings require double quotes, single quotes are for single characters. You have single quotes around "quit" by mistake.
Topic archived. No new replies allowed.