Basic structure of C language ( Module 2).
In this module we will discuss on the basic structure of C language which is implemented during writing every program in C.
Do you have similar website/ Product?
Show in this page just for only
$2 (for a month)
0/60
0/180
Basic structure of C language :-
The program written in C language follows this basic structure. The sequence of sections should be as they are in basic structure. A C programs should have one or more sections but the sequence of sections is to be followed.
- Documentation sections.
- Linking section.
- Definition section.
- Global declaration section.
- Sub program or function section.
- Main function section.
- Declaration section.
- Executable section.
It comes first and is used to document the use of logic or reasons in the program. It can be used to write the program's objective, developer and logic details. The documentation section is done in C language with /* and */ whatever is written in between these two are called comments.
Linking section :-
This section tells the compiler to link the certain occurrence of keywords or function in our program to the header files specified in this section.
Definition section :-
It is used to declare some constants and assign them some value. Eg. #define max 25. Here #define is a compiler directives which tells the conpiler whenever max is found in the program replace it with 25.
Global declaration section :-
Here the variables which are used throughout the program (including main and other functions) are declared so as to make them global.
Main function section :-
It tells the compiler where to start the execution from.
main()
{ point from execution starts }.
Main function has two sections :-
1. Declaration section : In this the variables and their data types are declared.
2. Executable section : This has the part of program which actually performs the task we need.
Sub program or function section :-
This has all the sub programs or the functions which our program needs.
CONTINUE READING
Programming in c
coding
Dalpat I
Content writer