Hello everyone, I was studying the use of namespaces and tried to take a simple example, which in part works but the process is suspended, not closed.
First things first, this is my example:
geometria.h
Qt Code:
  1. #ifndef GEOMETRIA_H
  2. #define GEOMETRIA_H
  3.  
  4. namespace Geometria {
  5. float Norma(int i) {
  6. float risultato = (float)i/6;
  7. return risultato;
  8. }
  9. }
  10.  
  11. #endif // GEOMETRIA_H
To copy to clipboard, switch view to plain text mode 
main.cpp
Qt Code:
  1. #include <QCoreApplication>
  2. #include <iostream>
  3. #include "geometria.h"
  4.  
  5. using namespace std;
  6. using namespace Geometria;
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10. QCoreApplication a(argc, argv);
  11.  
  12. float ris = Norma(3);
  13. cout << "Il risultato è: " << ris << endl;
  14.  
  15. return a.exec();
  16. }
To copy to clipboard, switch view to plain text mode 
When I launch the program, I see the result in Qt-Creator 2.5.0 but the program does not close, I have to do it by CTRL + ALT + DEL.
Can you tell me where I went wrong?