VK> Well the subject says it all.
VK> Unless the end of it got truncated in which case it said:
VK> "How do you read command line parameters?"
Simple. Declare main with an "int" and "char**" parameter, and use those:
int main (int argc, /* Number of arguments on cmd line */
char **argv) /* Cmd line arguments */
{
if (argc > 1)
{
int i;
for (i=1; i < argc; i++)
cout << "Cmdline argument " << i << ": " << argv[i] << endl;
}
else
cout << "You didn't specify any cmdline arguments!" << endl;
return 0;
}
--- PointEd 2.0
---------------
* Origin: The Tibbs' Point - Ottawa, Ontario, Canada (1:163/215.38)
|