Mega Code Archive

 
Categories / C++ / Qt
 

Search in a list of fruit names first for the word Pear and then for Orange

#include <QStringList> #include <QDebug> int main() {   QStringList list;   list << "apple" << "pear" << "banana";   QStringList::iterator i1 = qFind(list.begin(), list.end(), "pear");   QStringList::iterator i2 = qFind(list.begin(), list.end(), "orange");   return 0; }