C/Command Line Arguments
Expert: Zlatko - 3/12/2011
QuestionWhat is the use of command line arguments in GUI OS? or
How can we make use of command line arguments in Windows programs with GUI?
AnswerHello Sreyas
Command line arguments can be useful in a GUI program. How to use them depends on your problem and your imagination. I have used them to turn on special debug modes that only the programmer needs. I have also used them to start the GUI program at a specific location on the screen. Use them for anything that needs to be known before the GUI appears.
How to access command line arguments depends on the language you are using and depends on if your program has a main function or if the main function is hidden in the GUI library. If you have access to the main function, then access the command line arguments though the usual argc/argv parameters. If you are using a GUI framework, you will have to do some internet searching on your framework.
I hope that helps you out.
Best regards
Zlatko