Introduction to Functions in C
This “Introduction to Functions in C” page providing introduction to functions including definition, advantages of functions in programming languages.
- A function is a block of code that performs a specific task.
- It has a name and it is reusable.
- Function taking input, processing input and produce output.
- It can be accessed from as many different parts in a C Program as required.
- The main advantage of function is code re-usability.
- Using functions we can implement modularity programming.
- The use of user-defined functions allows a large program to be down into a number of smaller, self-contained components, each of which has some unique, identifiable purpose.
- Thus a C program can be modularized through the intelligent use of such functions.
Functions Classified into:
- Built In Functions
- User Defined Functions
Built in Functions:
- C-language has library.
- Library is a collection of header files.
- Header file is a collection of pre-defined functions.
- These functions are also called as ‘library functions’.
User Defined Functions:
- A programmer defined function depends on application requirement.
- Need to follow syntactical rules to define a function.
- It is possible for the programmer to define user header files.