The foreach Keyword : foreach « Qt « C++






The foreach Keyword

  

#include <QStringList>
#include <QDebug>

int main()
{
  QStringList names;
  names << "Patricia" << "Markus" << "Uli";
  foreach(QString name, names)
    qDebug() << name;
  return 0;
}

   
    
  








Related examples in the same category