diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-21 11:08:37 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-21 11:08:37 +0200 |
commit | eb649ff736e101e49afacb31d580741851375e69 (patch) | |
tree | c615d4aa2323c6581cff9bd17fae2204b7ed6dae /hello.cxx |
Basic "Hello World" C++ program with build2
Diffstat (limited to 'hello.cxx')
-rw-r--r-- | hello.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/hello.cxx b/hello.cxx new file mode 100644 index 0000000..c105d17 --- /dev/null +++ b/hello.cxx @@ -0,0 +1,22 @@ +// file: hello.cxx -*- C++ -*- + +#include <iostream> + +#include <hello/hello> + +using namespace std; + +int +main (int argc, char* argv[]) +{ + if (argc < 2) + { + cerr << "usage: hello <name>..." << endl; + return 1; + } + + using hello::say; + + for (int i (1); i != argc; ++i) + say (argv[i]); +} |