Hi
Maybe you should start reading some basic c tutorials. Two decent ones have been
written by white_scorpion[1]. In the beginner tutorial, you learn about printf,
in the intermediate one %s is explained.
The line
simply prints the program arguments on the console.Code:for (i=0;i<argc;i++) printf("%s\n",argv[i]);
I would not try to achieve too much at once. First, learn to understand
how that little program is doing what it is doing.
char *argv[] are somewhat "advanced" data types (pointers and arrays).
But if you want to convert the first parameter to an integer, try an
If you want to check the second parameter char by char, try anCode:i = atoi(argv[1])
CheersCode:for (i=0;i<strlen(argv[2]);i++) printf("%c",argv[2][i]);
[1] http://www.antionline.com/search.php...orumchoice=678




Reply With Quote