Hello
I have to input two strings from the command line, and then pass those words into a method. How would I be able to accompish that
Thanks.......
Printable View
Hello
I have to input two strings from the command line, and then pass those words into a method. How would I be able to accompish that
Thanks.......
int main ( in argc, char **argv )
argv is an array of strings that you will pass to another function. argv[0] is always the program name, any strings after that will be what you want to pass. So if your command line input was:
c:\ programName string1 string2
You would pass string1 and string2 like so:
/* Function definition */
void function ( char *stringOne, char *stringTwo );
/* Function call */
function ( argv[1], argv[2] );
-Prelude