VK> Well the subject says it all.
Congratulations, I think you'll get about a thousand replies on this one.
instead of:
int main(void)
you write:
int main(int argc, char **argv)
I hope you define main as int, or else you are evil.
The command line is broken up into every word (with null termination) and put
into argv[], with the program name in argv[0].
If more than one word is typed in quotes, it is still considered one word.
Quotation mark is typed in as \".
C:\FOO\>BAR -mmmm /bop "hanson sucks" beep\"beep
argc = 5
argv[0] = BAR (or BAR.EXE or C:\FOO\BAR.EXE or similar. Depends on
compiler)
argv[1] = -mmmm
argv[2] = /bop
argv[3] = hanson sucks
argv[4] = beep"beep
for (c = 1; c < argc; c++)
ProcessCommandLine(argv[c]);
---
---------------
* Origin: Is it morning already? (2:201/293.22)
|