Basic Structure of a C program:
Preprocessor directives
Global declarations
int main (void)
{
Local Declarations
Statements
return 0;
}
Preprocessor Directives:
- In C, the C preprocessor executes before a program is compiled
- The Preprocessor Directives begin with "#"
- It is having 3 types of preprocessor directives are Macros, Inclusion of other files in the file being compiled, and Condition Compilation of a C code.
Global Declarations:
- We are declaring this Global variable outside of any function.
- accessed by any statement in the entire program.
- stored on a fixed location decided by a compiler.
- This part is used to declare the variables which are common for multiple/global/universal methods.
Local Declaration:
- Declare inside the function, that is we are declaring within the local variables within the part of the function block.
- These variables have local scope to that the function only, which they are declared.
- They cannot be accessed outside the function Block.
0 Comments
Please do not enter any spam links and Messages in the comment box.