Hello
How would I be able to read in a word off the command line and store it as a variable? Thanks
ex(prog name is test)
test word
-> I would like to store word into a variable
Thanks
This is a discussion on Command line within the Linux Programming forums, part of the Platform Specific Boards category; Hello How would I be able to read in a word off the command line and store it as a ...
Hello
How would I be able to read in a word off the command line and store it as a variable? Thanks
ex(prog name is test)
test word
-> I would like to store word into a variable
Thanks
int main(int argc, char* argv[]);
argc is the number of arguements. The first argument is the name of the program (in argv[0]), the second argument is whatever the second space delimited sequence was (and it's in argv[1]), the third is in argv[3], etc.