I have written very very simple console application which supports some command line options.
If there is no command line argument (it means there is only 1 argument) the application closes without showing black window, currently if you run the code below, because it has no command line arguments, it will close immediately, but it will show the black window for a second, I want to avoid it. So How Can I do it in a simple way?
#include <iostream>
using namespace std;
int main(int argc,char** argv)
{
if (argc==1) return 0;
if (argc!=1)
for (int i=2; i<=argc; i++)
cout << argv[i] << endl;
cin.sync();cin.get();
return 0;
}
You can’t escape from console window creation if you create console application.
But you can create win32 application with entry point WinMain and there do not create window, just work as console program.