Awesome
correct_cpp_show_args
Branch | Travis CI | Codecov |
---|---|---|
master |
Correct C++ chapter 'Show CLI arguments'.
Goal
- Display all command-line arguments using the STL
Prerequisites
- Understand how this course works
- Have written a correct 'hello_cli' program
Exercise
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