I installed qt 4.7.4 and gcc 4.6.1. I tried to compile this program but it won't compile for me:
Why cannot I compile this code?
#include <QApplication>
#include <iostream>
using std::cout;
int main(int argc, char** argv)
{
QApplication app(argc,argv);
int a[] = {1,2};
for (auto e : a)
{
cout << e << '\n';
}
return app.exec();
}
Error:
C:...\main.cpp:9: error: 'e' does not name a type