int main (int argc, char *argv[]) { QVector<QString> vec; vec << "xxx" << "yyy" << "zzz"; QVector<QString>::iterator it = vec.begin(); qDebug() << "before loop"; for (; it != vec.end(); ++it) { qDebug() << "Element:" << *it; } }
Standard input is empty
prog.cpp:3:5: error: use of undeclared identifier 'QVector' QVector<QString> vec; ^ prog.cpp:3:13: error: use of undeclared identifier 'QString' QVector<QString> vec; ^ prog.cpp:3:22: error: use of undeclared identifier 'vec' QVector<QString> vec; ^ prog.cpp:4:5: error: use of undeclared identifier 'vec' vec << "xxx" << "yyy" << "zzz"; ^ prog.cpp:5:5: error: use of undeclared identifier 'QVector' QVector<QString>::iterator it = vec.begin(); ^ prog.cpp:5:13: error: use of undeclared identifier 'QString' QVector<QString>::iterator it = vec.begin(); ^ prog.cpp:5:23: error: no member named 'iterator' in the global namespace; did you mean 'operator'? QVector<QString>::iterator it = vec.begin(); ~~^~~~~~~~ operator prog.cpp:5:32: error: unknown type name 'it' QVector<QString>::iterator it = vec.begin(); ^ prog.cpp:5:37: error: use of undeclared identifier 'vec' QVector<QString>::iterator it = vec.begin(); ^ prog.cpp:6:5: error: use of undeclared identifier 'qDebug' qDebug() << "before loop"; ^ prog.cpp:7:12: error: use of undeclared identifier 'it' for (; it != vec.end(); ++it) ^ prog.cpp:7:18: error: use of undeclared identifier 'vec' for (; it != vec.end(); ++it) ^ prog.cpp:7:31: error: use of undeclared identifier 'it' for (; it != vec.end(); ++it) ^ prog.cpp:9:9: error: use of undeclared identifier 'qDebug' qDebug() << "Element:" << *it; ^ prog.cpp:9:36: error: use of undeclared identifier 'it' qDebug() << "Element:" << *it; ^ 15 errors generated.
Standard output is empty