Hello World program in C++

This tutorial will show you how to make your first C++ program. It just print Hello,world! to console.

Requirements

  • any linux distro
  • gcc

Creating workspace

mkdir hello_cpp
cd hello_cpp
touch program.cpp

Code

Edit program.cpp

#include <iostream>

int main(){
 std::cout << "Hello,world" << std::endl;
 return 0;
}

Compilation & running

Run this in your console

g++ program.cpp
./a.out