Branch | Travis CI | Codecov |
---|---|---|
master |
Correct C++ chapter 'Show CLI arguments'.
- Display all command-line arguments using the STL
- Understand how this course works
- Have written a correct 'hello_cli' program
Write a command-line interface (CLI) program that displays all command-line arguments, seperated by spaces and followed by a newline.
Call to show_args |
Output | Exit status |
---|---|---|
./show_args |
show_args (with newline) |
0 |
./show_args hello |
show_args hello (with newline) |
0 |
./show_args hello world |
show_args hello world (with newline) |
0 |
- Do not use
for
- argv must be converted to a std::vector< std::string >
- Use std::copy to display the command-line arguments with std::cout