use this:
1. save your file
2. open terminal
3. cd into the directory your file is in
4. type the following into terminal, replacing <filename> with your filename:
gcc <filename>.c -o <filename>
or for C++ files:
g++ <filename>.cpp -o <filename>
the bit after the -o is the name the compilation will be named