summaryrefslogtreecommitdiff
path: root/hello.cpp
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-06-03 17:11:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-06-03 17:11:56 +0200
commit398bea3c765b031540bd17841c71825dcb7b62c7 (patch)
tree5893e4cbe74cd0974b23bf46addf5b2155b554a6 /hello.cpp
parentfccc41f63b78202d29f3f13b557166b931b4b520 (diff)
Add test, install support
Diffstat (limited to 'hello.cpp')
-rw-r--r--hello.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/hello.cpp b/hello.cpp
index 0dde4c9..fad8a40 100644
--- a/hello.cpp
+++ b/hello.cpp
@@ -1,6 +1,14 @@
#include <iostream>
-int main ()
+using namespace std;
+
+int main (int argc, char* argv[])
{
- std::cout << "Hello, World!" << std::endl;
+ if (argc != 2)
+ {
+ cerr << "usage: " << argv[0] << " <name>" << endl;
+ return 1;
+ }
+
+ cout << "Hello, " << argv[1] << "!" << endl;
}