It depends on the compiler; you'll usually see things like -D or \D. Look it up in your documentation.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
1. g++ -DHAVE_CONFIG -Wall -std=c++98 -o myprogram
2. ,/myprogram hello world
in 1., the command line args are used by the c preprocessor, some are forwarded to the compiler and linker
in 2., the command line args are passed to myprogram and are available as parameters passed to main
vijayan121
Posting Virtuoso
1,606 posts since Dec 2006
Reputation Points: 1,159
Solved Threads: 287
preprocessor directives/macros are processed at the time of compilation. Arguments relevant to preprocessor (e.g. -DXXX=value) are passed to compiler and used by compiler. Any argument passed on command line is called command line arguments. :). So these are the CLI args to compiler.
After compilation (and linking) the executable of your program is ready.. when you call/execute this executable with CLI args, these would go to main() and will be be available to your program.
thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75