#include in C
0 873
The #include directive in C is used to include header files, allowing access to external functions, variables, and declarations, enhancing code modularity and reusability.
2User-defined Header Files:
Includes custom header files using double quotes ("").
#include "myheader.h"
Example:
includes the standard I/O library header file, providing access to printf().
#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.
Types of #include in C
1System Header Files: Includes standard library header files using angle brackets (<>). #include#include<stdio.h>Output:// Including standard I/O header file int main() { printf("Hello, World!\n"); // Using printf function from stdio.h return 0; }
Hello, World!In this example: #include
Share:




Comments
Waiting for your comments