1#include <iostream>
2
3int main(){
4 std::cout << "Hello World!" << std::endl; // prints "Hello World"
5}
1#include <iostream>
2#include <string>
3
4int main( int argc, char* argv[] )
5{
6 std::string my_arg;
7
8 // First argument is always the name of your program
9 std::cout << argv[0] << std::endl;
10
11 if( argc == 2 )
12 {
13 // Something has been passed in
14 my_arg = argv[1];
15 std::cout << "Argument passed in is " << my_arg << std::endl;
16 }
17
18 return 0;
19}