Exforsys.com
 
Home Tutorials C Language
 

C Programming - An Overview

 

C Programming - An Overview - Page 2

Page 2 of 2


Executing a C Program


The following basic steps is carried out in executing a C Program.


1. Type the C lanuage program.


2. Store the program by giving a suitable name and following it with an extension .c


3. Compile the program


4. Debug the errors if any, that is displayed during compile.


5. Run the program.


Basic structure of C programs

.
.....Documentation Section
.....
.....Link Section
.....
.....Definition Section
.....
.....Global declaration Section
.....
.....main() function section
.....{
..........Declaration Section
.....
..........Executable Section

.....}


.....Sub-program Section


.....function1
.....{
..........Statements
.....}


.....function2
.....{
..........Statements
.....}


.....function3
.....{
..........Statements
.....}


.



The documentation section consists of a set of comment lines giving the name of the program, the author and other details such as a short description of the purpose of the program.


The link section provides instructions to the compiler to link functions from the system library.


The definition section defines all the symbolic constants. The variables can be declared inside the main function or before the main function.


Declaring the variables before the main function makes the variables accessible to all the functions in a C language program, such variables are called Global Variables.



Declaring the variables within main function makes the usage of the variables confined to the main function only and it is not accessible outside the main function.


Every C program must have one main function. Enclosed in the main function is the declaration and executable parts.


In the declaration part we have all the variables.


There is atleast one statement in the executable part.


The two parts must appear between the opening and closing braces


The sub-program section contains all the user-defined functions that are called in the main function.


User-defined functions are generally placed immediately after the main function although they may appear in any order.




First Page: C Programming - An Overview


Read Next: C Programming - Constants and Variables



 

 

Comments


sivasayanth said:

  good discribe
July 13, 2007, 12:09 pm

steven_ said:

  so easy and nice flow of language with description
December 8, 2008, 5:28 am

Mussa William aka Special_1 said:

  I like the way U present y're materials;god bless all of you.
December 12, 2008, 4:37 am

Harshad Patel said:

  Really very nice video
December 20, 2008, 11:27 am

Naveen Rawat said:

  Really Nice content
January 22, 2009, 1:00 am

Purnima said:

  I want to know the use of pcap.h to capture network packets
January 23, 2009, 9:21 am

sampath said:

  one of the best example of c
February 11, 2009, 12:38 am

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2009 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape