Hello World in C++


The simplist C++ program …

/* hello.cpp */

#include <iostream>

int
main() {
        std::cout << "Hello World" << std::endl;

        return 0;
};

Outputs …

Hello World

Compile and run with GCC

g++ hello.cpp && ./a.out

or Clang

clang++ hello.cpp && ./a.out