QApplication app(argc, argv)

Simplicity picture Simplicity · Apr 24, 2011 · Viewed 8.7k times · Source

I noticed that the main.cpp in a Qt application has to contain the following line:

QApplication app(argc, argv);

I know that argc is the number of command-line arguments, and argv is that array list of command-line arguments. But, the question in my mind is: what are those arguments I'm passing to the constructor and at the same time cannot explicitly see? What is working behind the scences out there?

Thanks.

Answer

Puppy picture Puppy · Apr 24, 2011

There are no hidden arguments. You can explicitly see every argument- argc, argv. There's nothing in that line of code that's behind the scenes.