Open up emacs and press “control x control f”. This write the name of your program and press enter. I found a really good video about getting use to emacs. Tutorial. Another great page that helped me a lot was this one. C++.
Once you have created your program, go to terminal and press ls. press “cd”and then write the location where you saved your program.
As you can see, after you have located your file, write g++, the name of your program and press enter.
Then write ./a.out, the name of your program and press enter.
In the last image you will notice that the program ran perfectly and printed out “Hello World! I’m a c++ program”. In case your wondering what it looks like when there is an error in your program here is another picture.