Thursday, April 15, 2010

A Simple C Program - #include Directives

Now let us move to line 2 for #include

The name of the stdio.h file stands for standard input-output header file. The stdio.h file contains numerous prototypes and macros to perform input or output (I/O) for C programs.

In C, #include forms a preprocessor directive that tells the C preprocessor to look for a file and place the contents of the file in the location where the #include directive indicates. Here, the #include directive does ask the C preprocessor to look for and place stdio.h where the directive is in the C program.

The preprocessor is a program that does some preparations for the C compiler before your code is compiled.

Header Files

The files that are required by the #include directive, like stdio.h, are called header files because the #include directives are almost always placed at the head of C programs. Actually, the extension name of .h does mean "header."

Besides stdio.h, there are more header files, such as stdlib.h, string.h, math.h, and so on.




No comments:

Post a Comment