g++ is just a terminal program that compiles .cpp files, gcc is to compile .c files.
If you were wanting to compile a .cpp file and it was on your desktop the commands would look like this;
Code:
cd "Desktop"
Desktop> g++ thefile.cpp -o thefile
and if you wanted to do a .c file and it was on your desktop the commands would look like this;
Code:
cd "Desktop"
Desktop> gcc thefile.c -o thefile