diff options
Diffstat (limited to 'hello.cpp')
-rw-r--r-- | hello.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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; } |