VK> Well the subject says it all.
VK> "How do you read command line parameters?"
The command line arguments are passed as an array
of pointers to arrays of type char.
#include
int main(int argc, char *argv[])
{
for(int argument = 0; argument < argc; argument++)
puts(argv[argument]);
return 0;
}
In this case, argc will be the number of arguments on the
command line, which must always be at least one, since the
command to execute the program is the first argument.
The argument will be found as a string called argv[0], which
is the first string pointer in the argv array of pointers.
The example code will print out each argument entered on the
command line. You can analyze them and do whatever you want,
according to what they are, within your code.
> ] Abandoning .. Perfect Truth .. I become .. My own Illusion..
---
---------------
* Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750)
|