Compilation and linking of the c program involves below
steps.
- Pre processing – Macro substitution, including of header files.
- Compilation – generated assembler code.
- Assembly – creates object file.
- Linking – creates executable file by linking library code.
Turbo C compiler
Figure 1-Compiling and Executing the program in turbo C
|
-
We can compile c programs using turbo c compiler or Microsoft visual C++.To compile, build and execute C program in Turbo, you can press ctrl+F9 key combination.To compile, build and execute C program in Visual C++, you can press ctrl+F5 key combination.Below image shows how turbo IDE looks like.
Typical phases of C program execution are given in below diagram. The sample.c file contains the source code. After compiling the sample.c, new file is created called sample.obj. This is a intermediate machine code generated by compiler. This is also called as an object file. After compiling the c file, we link the obj file and final exe file is created which can be used to execute the c program.GCC compiler in windows.
To compile the program using GCC compiler, use below command from command prompt in windows.> Gcc abc.cAfter compiling the program, a.exe file is created which can be used to execute the c program.
No comments:
Post a Comment
Leave your valuable feedback. Your thoughts do matter to us.