sudo apt-get update
you can as well precise the version after the g++
sudo apt-get install g++
compile your cpp or cpps files
g++ <name with extension >
# for example
g++ main.cpp
./a.out
# not neccessarily the name of the executable is a but here as we didnt precise it it will be to specify it use
#alternative
g++ -o main.exe hello.cpp