In every C program The compile Executics the program stepby step to check and find errors in program today I will tell you how the Compiler check the pogram.
Step By Step Execution Of C Program:-
Step 1 : Edit
- This is First Step i.e Creating and Editing Program.
- First Write C Program using Text Editor , such as [ Borland C/C++ 3.0 , Notpad++,Notpad ]
- Save Program by using [.C] Extension.
- File Saved with [.C] extension is called “Source Program“.
Step 2 : Compiling:-
- Compiling C Program : C Source code with [.C] Extension is given as input to compiler and compiler convert it into Equivalent Machine Instruction.
- In Borland C/C++ 3.0 program can be compiled using key [Alt + F9 ].
- Compiler Checks for errors . If source code is error-free then Code is converted into Object File [.Obj ].
Step 3 : Checking Errors
- During Compilation Compiler will check for error, If compiler finds any error then it will report it.
- User have to re-edit the program.
- After re-editing program , Compiler again check for any error.
- If program is error-free then program is linked with appropriate libraries.
Step 4 : Linking Libraries
- Program is linked with included header files.
- Program is linked with other libraries.
- This process is executed by Linker.
Step 5 : Error Checking
- If run time error occurs then “Run-time” errors are reported to user.
- Again programmer have to review code and check for the solution.
No comments: