Exactly!!!!
In order to do this you must create parameters for the main function
EX:
int main(int argc, char *argv[]) {
char x = *argv[1];
int a, b;
a = atoi(argv[2]);
b = atoi(argv[3]);
}
now ignore the atoi function if you don't know what it is. (Parsing function)
What the above shows is parameters that are used for the example I posted above
this can apply to anything.
The argv[] applies to what you type after your program in the console window
so if its the first parameter it will be argv[1]
now this may be slightly confusing if you don't understand pointers so if you have any more questions about it just ask.
~ Geo
~ Don't take life too seriously, you'll never get out alive!
|