Compiler
Command
Microsoft C
cl radius.c
Borland’s Turbo C
tcc radius.c
Borland C
bcc radius.c
Zortec C
ztc radius.c
If you’re using a graphical development environment, compiling is even simpler. In most graphical environments, you can compile a program listing by selecting the compile icon or selecting something from a menu. Once the code is compiled, selecting the run icon or selecting something from a menu will execute the program. You should check your compiler’s manuals for specifics on compiling and running a program. After you compile, you have an object file. If you look at a list of the files in the directory or folder in which you compiled, you should find a file that has the same name as your source file, but with an .OBJ (rather than a .C) extension. The .OBJ extension is recognized as an object file and is used by the linker. On UNIX systems, the compiler creates object files with an extension of .O instead of .OBJ. Linking To Creating An Executable File One more step is required before you can run your program. Part of the C language is a function library that contains object code (code that has already been compiled) for predefined functions. A predefined function contains C code that has already been written and is supplied in a ready-to-use form with your compiler package. The printf() function used in the previous example is a library function. These library functions perform frequently needed tasks, such as displaying information on-screen and reading data from disk files. If your program uses any of these functions (and hardly a program exists that doesn’t use at least one), the object file produced when your source code was compiled must be combined with object code from the function library to create the final executable program. (Executable means that the program can be run, or executed, on your computer.) This process is called linking, and it’s performed by a program called (you guessed it) a linker. Figure 1.1 shows the progression from source code to object code to executable program

Figure 1.1. The C source code that you write is converted to object code by the compiler and then to an executable file by the linker
Once your program is compiled and linked to create an executable file, you can run it by entering its name at the system prompt or just like you would run any other program. If you run the program and receive results different from what you thought you would, you need to go back to the first step. You must identify what caused the problem and correct it in the source code. When you make a change to the source code, you need to recompile and relink the program to create a corrected version of the executable file. You keep following this cycle until you get the program to execute exactly as you intended.
One final note on compiling and linking: Although compiling and linking are mentioned as two separate steps, many compilers, such as the DOS compilers mentioned earlier, do both as one step. Regardless of the method by which compiling and linking are accomplished, understand that these two processes, even when done with one command, are two separate actions.
The C Development Cycle
Step 1: Use an editor to write your source code. By tradition, C source code files have the extension .C (for example, MYPROG.C, DATABASE.C, and so on).
Step 2: Compile the program using a compiler. If the compiler doesn’t find any errors in the program, it produces an object file. The compiler produces object files with
an .OBJ extension and the same name as the source code file (for example, MYPROG.C compiles to MYPROG.OBJ). If the compiler finds errors, it reports them. You must return to step 1 to make corrections in your source code. Step 3: Link the program using a linker. If no errors occur, the linker produces an executable program located in a disk file with an .EXE extension and the same name as the object file (for example, MYPROG.OBJ is linked to create MYPROG.EXE). Step 4: Execute the program. You should test to determine whether it functions properly. If not, start again with step 1 and make modifications and additions to your source code. Figure 1.2 shows the program development steps. For all but the simplest programs, you might go through this sequence many times before finishing your program. Even the most experienced programmers can’t sit down and write a complete, error-free program in just one step! Because you’ll be running through the edit-compile-link-test cycle many times, it’s important to become familiar with your tools: the editor, compiler, and linker.