C program Life Cycle - TGN

Latest

Welcome to Technicalgurunow! Your No. 1 source for all networking , earning and programming tutorials. We're dedicated to providing you the best of knowledgeable information with a focus on dependability. We hope you enjoy our blog.

Thursday, December 5, 2019

C program Life Cycle

C program Life Cycle

There are 4 steps to create any program in C. These steps are in a certain order and each of these steps has its own significance.
  1. Editing  (.c)
  2. Compiling ( .obj)
  3. Linking  (.exe)
  4. Executable file
  • First of all, you write a program. This is called the editing part of the program development life cycle. This program is in human readable format.
  • After that you compile the program. This is the second step of the development life cycle. By removing all the errors in this part, the program is converted to binary format so that the computer can process it.
  • After this comes the linking process. In this process the program is linked with the necessary libraries. As such, you know that even the basic program of C cannot be executed without including libraries. Libraries provide the environment for the C program to execute.
  • After this the executable file is produced. Which you can execute as many times as you want. The output of the editing process is a .c source file. The input source of the compiling process is .c file and output is .obj file. The input to the linking process is .obj file and output is .exe file.

  • Structure of C program :
how to execute c program?

  • First C program :
    • The first line includes the <stdio.h> header file in the program. It is a standard input / output header file that handles input and output in the program.
    • Preprocessor directives are used to include them in the program. After this the main () function is initialized. The execution of the program starts from the main function. All instructions are written in this function.
    • The start and end of the main function are shown by curly brackets. All the instructions inside these curly brackets are executed.
    • The main function is defined with int type. This is a standard. The main function always has to return an integer value. If you do not return any value from the main () function in the program, then at the end of the program write a return 0 statement.
    • In the main function you can also pass arguments which are called command line arguments. For more information about these, read the C Language Command Line Arguments in Easy Programming tutorial.

No comments:

Post a Comment

If you have any query, please let me know

Followers