Linux has no particular strictness over file extensions therefore binary files don't normally end in .exe
To create binaries from a C/C++ source file. You need a compiler such as GCC for .c and g++ for .cpp. These can be obtained from your Linux distro repository manager e.g in opensuse
sudo zypper install gcc g++
To compile a c source file named myfile.c to create a binary called myfile.
cd /path/to/myfile/
gcc -o myfile myfile.c
For a c++ source file.
$cd /path/to/myfile/
$g++ -o myfile myfile.cpp
For several C source files you can create appropriate header files and use ar command to create a static or shared library then link them e.g to create a static library from 2 c source files.
$cd /path/to/sources/
$gcc -c myfile1.c myfile2.c
$ar rs libmyfiles.a myfile1.o myfile2.o
$gcc -o main main.c -I/path/to/header-files/ -L/path/to/libmyfiles.a
The -c flag creates .o (object file) containing hexadecimal routines that are archived and indexed by the ar command into a static library called libmyfiles.a . shared libraries end in .so and need to be prduced with position-independent code (-lfpic).
However to link to an existing shared library e.g the pthread when you have used threading header file pthread.h you can link to the library as follows.
$gcc -o threadc thread.c -lpthread
To run the main program at the command line
$./mainprog
Where mainprog can be the name of the output binary file.
You can also look into makefiles that ease the amount of work needed to compile large projects.
There are also manual pages containing information about compiler flags
man gcc
or if you use KDE . you can insert this at the konqueror browser address bar for well formatted output.
man:gcc