int main(int argc, char *argv)
for(counter=0; counter<argc; counter++)
sh-4.2$ ./main Hello world "how are you?"
argv[ 0]: ./main
argv[ 1]: Hello
argv[ 2]: world
argv[ 3]: how are you?
Consider the output
./main, Hello, and world are the single word argument while "how are you?" is multiple words arguments, to pass multiple words in command line, we can enclose them in double quotes.
total answers (1)
start bookmarking useful questions and collections and save it into your
own study-lists, login now to start creating your own collections.