#include in C
0 232
The #include directive in C is used to include header files, allowing access to external functions, variables, and declarations, enhancing code modularity and reusability.
Types of #include in C
1System Header Files:
Includes standard library header files using angle brackets (<>).
#include
2User-defined Header Files:
Includes custom header files using double quotes ("").
#include "myheader.h"
Example:
#include<stdio.h>// Including standard I/O header file int main() { printf("Hello, World!\n"); // Using printf function from stdio.h return 0; }
Output:
Hello, World!
In this example:
#include
#include "myheader.h" includes a user-defined header file, which may contain custom function declarations, variables, or macros.
Both types of #include directives that contribute to organizing and extending the functionality of the C program.
Share:
Comments
Waiting for your comments