IEO Level 2- English Olympiad (SOF) Class 9 Coaching Programs
⏳ 🎯 Online Tests (2 Tests [50 Questions Each]): NTA Pattern, Analytics & Explanations
Click Here to View & Get Complete Material
Rs. 200.00
3 Year Validity (Multiple Devices)
🎓 Study Material (303 Notes): 2024-2025 Syllabus
Click Here to View & Get Complete Material
Rs. 450.00
3 Year Validity (Multiple Devices)
🎯 250 MCQs (& PYQs) with Full Explanations (2024-2025 Exam)
Click Here to View & Get Complete Material
Rs. 200.00
3 Year Validity (Multiple Devices)
Function: Introduction, Objectives, Include Directive and Library Functions
Introduction
Functions in C ++ are available under C ++ library header files. It provides declarations of the function prototypes, class definition, etc.
For example,
double sqrt (float) .
The above declaration specifies that the sqrt function takes only one argument of type float and return double type.
To make use of predefined functions, the header file (that contains the functions prototypes) must be included in a program using preprocessor directive # include.
Objectives
After going through this lesson, you would be able to:
- Familiarize with the use of # include directive and its requirement in the program
- Define functions included in math. h, ctype. h and string. h header files
- Explain character handling functions which help in input/output operations
- Define inline function and function with default value.
Include Directive
- They include directive instructs the compiler to read and include another file in the current file.
- The compiler compiles the entire code.
- A header file may be included in one of two ways.
# include < iostream. h >
or
# include “iostream. h”
- The header file in angle brackets means that file reside in standard include directory. The header file in double quotes means that file reside in current directory.
Library Functions
- The C language is accompanied by a number of standard library functions which carry out various useful tasks.
- In particular, all input and output operations (e. g. , writing to the terminal) and all math operations (e. g. , evaluation of sines and cosines) are implemented by library functions
- C ++ provides many built-in functions that saves the programming time.