#include <QtCore/QCoreApplication>
#include <QList>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QList<QString> list;
list << "A" << "B" <<"C" << "D";
QList<QString>::iterator i;
qDebug() << "the forward is :";
for (i=list.begin(); i!=list.end();++i){
*i=(*i).toLower();
qDebug() << *i;
}
qDebug() << "the backward is :";
while(i!=list.begin()){
--i;
qDebug() << *i;
}
QList<QString>::const_iterator j;
qDebug() << "the forward is:";
for(j=list.constBegin();
j!=list.constEnd();
++j)
qDebug() << *j;
return a.exec();
}
myIterator
最新推荐文章于 2022-06-09 17:09:39 发布