The title of the topic pretty says it all - how to send an error message if there are no command line arguments given? Allow me to explain to what I'm trying to do.
I would like to create an executable called "Launcher" launching another executable called "Engine". Now, I do not want the user to launch "Engine" without starting "Launcher" first, because "Launcher" gives brief instructions for "Engine" how it should operate. If there are no command line arguments given, error message should pop up saying: "
Another way will be using environment variables -> set them in Launcher, then execute Engine; all environment variables will be kept and no other processes can see them (command line arguments can be easily read by external tools, like task manager).
__FILE__ expands to the name of the current code file.
Normally argv[0] contains the name that was used to start the program. The standard also allows argv[0] to be "" or argc to be 0.