Compiling in Emacs

Compile your program in emacs with the "ESC x compile" command.  Then
edit the command buffer by replacing "make -k" with "g++ hello.cpp" or
"CC hello.cpp".  The screen will split into two windows: Your program
in the upper window, and g++ in the lower window.  If you get error
messages step through them with C-X ` and correct them.

Running Your Program in Emacs

When your program compiles without syntax errors, suspend Emacs
(with the c-z command), and run a.out from the command line
(that is, at the Unix shell level).

After running a.out, resume Emacs by entering %1 (where 1 is
the jobid of the Emacs process running in the background).

In Emacs, to return to "one window" mode, type c-x 1.

Now, replace "World" in the hello, world program with your
name in the source code, recompile, suspend Emacs, run a.out
at the shell, and then resume Emacs (do NOT restart Emacs).

You've now written a program that greets you by name.