If it's for a package (someone else made it) you'll probably want to use "make" -- probably after first running "configure".
But I'm assuming you've written a program yourself, and saved it in some file (usually with a cpp, cxx or C suffix).
If it's just a simple program just run g++ (a part of gcc -- the GNU Compiler Collection)... it's probably already installed, if not, install the C++ part of the GCC (because you almost undoubtfully already have the C part). Type something like g++ -o myprog myprog.cpp
This will compile and link the sourcecode to a ready-to-run executable.
Here myprog.cpp is the sourcefile, and the name after -o is what the executeble will be called. If you don't specify what you want the execuatble to be called, it will be called a.out
The executable (myprog) should already have the x (executable) permission set, if not, type: chmod a+x myprog
To run your program type: ./myprog
You need the ./ first to force linux to run an executable not in the normal search PATH for executables. Usually a user *will not* put the current-directory (.) in his searchpath -- and if he does, he'll put it in the end. root should *never* have current-directory (.) in his searchpath.