Question: Write the program reverseArgs.cpp that takes command line input arguments and prints them back in reverse order. For example, if you ran the program as
Write the program reverseArgs.cpp that takes command line input arguments and prints them back in reverse order. For example, if you ran the program as ./reverseArgs first_arg second_arg, you would get an output back of second_arg first_arg. If you ran the program as ./reverseArgs I love gorgonzola cheese, but I hate toothpaste, you would get an output back of toothpaste hate I but cheese, gorgonzola love I. This is why I (lovingly) refer to this exercise as the Yoda program If you ran the program with double quotes, then the words within should act as one unit. For example: ./reverseArgs I would rather be at "UC Santa Barbara" would output: UC Santa Barbara at be rather would I. You are only permitted to use the iostream library. A session should look exactly like the following example (including whitespace and formatting - note that there is no whitespace at the end of each of these lines and each printed line has a newline at the end), with all manners of different numbers for inputs and the output:
Write the program reverseArgs.cpp that takes command line input arguments and prints them back in reverse order. For example, if you ran the program as ./reverseArgs first arg second arg, you would get an output back of second arg first arg If you ran the program as /reverseArgs I love gorgonzola cheese, but I hate toothpaste, you would get an output back of toothpaste hate I but cheese gorgonzola love I. This is why I (lovingly) refer to this exercise as "the Yoda program"... If you ran the program with double quotes, then the words within should act as one unit. For example reverseArgs I would rather be at "Uc Santa Barbara would output: UC Santa Barbara at be rather would I. You are only permitted to use the iostream library. A session should look exactly like the following example (including whitespace and formatting note that there is no whitespace at the end of each of these lines and each printed line has a newline at the end), with all manners of different numbers for inputs and the output: /reverseArgs ./reverse Args Hello Hello /reverseArgs Hello is it me me it is Hello ./reverse Args Hello is it me "you're looking for?" you're looking for? me it is Hello ./reverse Args You Are Not a Jedil Jedi a Not Are You
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
