Compiling C++ using g++ in ubuntu Linux

#include <iostream>
 int main()
{
 std::cout << "Hello World!" << std::endl;
 return 0;
}

g++ hello.cc -o hello
./hello

Configuring VS Code

Ctrl+Shift+P => Configure Task Runner to generate/edit task.json

The contents of task.json:

{
 “version”: “0.1.0”,
 “command”: “g++”,
 “isShellCommand”: true,
 “args”: [“-g”, “${file}”],
 “showOutput”: “always”
}