Hello!

I've got simple console application and I've got some questions.

Qt Code:
  1. #include <QtCore/QCoreApplication>
  2. #include <QTextStream>
  3.  
  4. QString temp;
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. QTextStream out(stdout);
  9. temp = "test";
  10.  
  11. QCoreApplication a(argc, argv);
  12.  
  13. out << temp << endl;
  14.  
  15. return a.exec();
  16. }
To copy to clipboard, switch view to plain text mode 

First - is the order of code correct? Where should be "QCoreApplication a(argc, argv);"? As i assume "return a.exec();" should be at the end?
What about exiting the application? When I run it in console, it works all the time - don't exits.

thanks in advance
best regards
Tomasz