i have made a queue using STL. the queue contains strings only. how to check for a particular string if it present in queue or not?
shanki himanshu
27
Light Poster
Recommended Answers
Jump to Postwhat STL container did you use?
Jump to PostYou don't use strcmp with std::string, instead std::string has == operator that returns true if the two strings are equal, false otherwise. for example
std::string s = "Hello"; if( s == "HELLO" ) { }
All 5 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
shanki himanshu
27
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
shanki himanshu
27
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.