The #include Directive
C programs are divided into modules or functions. Some functions are written by users, like us, and many others are stored in the C library. Library functions are grouped category wise and stored in different files known as header files. If we want to access the functions stored in the library, it is necessary to tell the compiler about the files to be accessed. This is achieved by using the preprocessor directive #include as follows: #include filename Filename is the name of the library file that contains the required function definition. Preprocessor directives are placed at the beginning of a program.
We use #include directive to include contents of another file (especially header file's) to a program. We can include a file in two different ways.
#include file.h
This variant of including header file, searches header file in the "standard header file directory". Standard header file directory is the path where all header files are stored.
#include "file"
We use this variant of including file when we want to include our own/custom header file. It searches the file in the current directory and then in the standard header file’s directory.
The #define Directive
A #define is a preprocessor compiler directive and not a statement. Therefore #define lines should not end with a semicolon. Symbolic constants are generally written in uppercase so that they are easily distinguished from lowercase variable names. #define instructions are usually place beginning before the main() function Symbolic constants are not declared in declaration section.
We use it to define a name for particular value/constant/expression. C preprocessor processes the defined name and replace each occurrence of a particular string/defined name (macro name) with a given value (micro body).
Syntax to define a MACRO using #define
#define MACRO_NAME macro_body
Here, MACRO_NAME is a C identifier and macro_body is string/value/expression.
-----------------------------------------------------This video will help you to learn:
What are the ways of passing parameters to the function?
When is Call by value and call by reference used?
Call By Value & Call By Reference in C:
1) Call by value method of passing arguments to a function.
2) Call by reference method of passing arguments to a function
3) Example of the call by value method of passing the arguments.
4) Example of the call by reference method of passing the arguments.
_____________________________________Thanks For Watching This Video.
LIKE || COMMENT || SHARE || SUBSCRIBE Now...
……………………………………………………………………..
Facebook Page: / foat2023
……………………………………………………………………..
1. Join with me in Masters admission preparation group: / 858042971559671
2. Join with me in Twitter : / mustakimbillah1
3. Join with me in Linked in : / mustakimbillah
……………………………………………………………………..
1. Increment and Decrement Operator: • Increment and Decrement Operator|| C Progr...
2. Conditional Operator: • Conditional Operator||C programming||[Bang...
3. Bitwise Operator: • Bitwise Operator||C programming|| C Progra...
4. infinite while loop: • infinite while loop||C programming||[Bangl...
5. Break and Continue: • Break and Continue with coding||C programm...
6. User define function: • User define function||C programming||[Bang...
7. Structure data type: • Structure data type in C || C programming ...
8. Structure in c with coding: • Structure in c with coding || C programmin...
9. call by value and call by reference: • call by value and call by reference || C p...
10. call by value and call by reference (coding): • call by value and call by reference (codin...
11. Area of Circle: • Area of Circle|C Programming|[Bangla Tutor...
12. Swapping two variables in C: • Swapping two variables in C || swapping in...
13. Swapping Two Numbers Without Using Third Variable: • Swapping Two Numbers Without Using Third V...
14. Perfect Number in C programming: • Perfect Number in C programming [ Bangla T...
15. Prime Number in C programming: • Prime Number || C programming || [ Bangla ...
16. Header file: • Header file || #include stdio.h #define PI...
17. Interview or Viva for C programming: • Interview or Viva for C programming || Pra...
18. Program Solve: • Program Solve || C Programming || CSE || C...
19. Program Solve || MSc Admission Test: • Program Solve || MSc Admission Test
20. Return 0 in Programming: • Return 0 in Programming
……………………………………………………………………..
#cprogramming
#programminglanguage
#headerFile