Mail Archives: djgpp/1999/01/07/19:44:57
Bonifati wrote:
>
> I'm a novice and need help:
> programming in C++, how can I take command line string parameters?
Use the parameters to `main'. Experiment with this program, it should
give you an idea.
(This is C but C++ works the same.)
#include <stdio.h>
int main(int argc, char *argv[])
{
int i;
for (i = 0; i < argc; i++)
printf("argv[%d] = \"%s\"\n", i, argv[i]);
return 0;
}
For more info, see your C++ book. Get one.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -