Home

Awesome

correct_cpp_hello_cli

BranchTravis CICodecov
masterBuild Statuscodecov.io

Correct C++ chapter 'Hello CLI'.

:warning: this course does not work until I've updated the scripts to use GitHub Actions :warning:

Goal

Prerequisites

Exercise

Write a command-line interface (CLI) program that writes Hello to the screen.

If the user has supplied a command-line argument, show it, after adding a space between 'Hello' and the argument. Ignore command-line arguments beyond the first. In all cases, the output should be followed by a newline:

Call to hello_cliResult
./hello_cliHello (with newline)
./hello_cli worldHello world (with newline)
./hello_cli world i_am_ignoredHello world (with newline)

This is the code you start with:

main(argc, argv)
{
  //Your code here
}

External links

References