Originally posted by belusha
hi..
could somebody explain to me about command line arguments?
[--snip--]
could somebody give me a sample output? would appreciate it. thank you.
Search the board. This is a common question. Any C book will cover this.
Code:
#include <stdio.h>
int main ( int argc, char*argv[] )
{
int x;
for( x = 0; x < argc; x++ )
{
printf("%s ", argv[x] );
}
printf("\n");
for( x = 0; x < argc; x++ )
printf("argv[%d] is \'%s\'\n", x, argv[x] );
return 0;
}
Search the board if you need more. Call this from a console window with as many arguments as you like. Example:
myprog arg1 arg2 arg3 adf asdf 324
Quzah.