C Programming - C Preprocessor - Discussion

Discussion Forum : C Preprocessor - True / False Questions (Q.No. 12)
12.
A header file contains macros, structure declaration and function prototypes.
True
False
Answer: Option
Explanation:

True, the header file contains classes, function prototypes, structure declaration, macros.

Discussion:
2 comments Page 1 of 1.

Kiran said:   1 decade ago
Can anyone give some example for this?

Reshu said:   1 decade ago
A look through any of the standard header files can give you a good idea of the sort of information found in them. The most common forms of header contents include the following:.

Manifest constants : A typical stdio.h file, for instance, defines EOF, NULL, and BUFSIZ (the size of the standard I/O buffer).

Macro functions : For example, getchar() is usually defined as getc (stdin) , getc() is usually defined as a rather complex macro, and the ctype. H header typically contains macro definitions for the ctype functions.

Function declarations : The string.h header (strings.h on some older systems) , for example, contains function declarations for the family of string functions. Under ANSI C, the declarations are in function prototype form.

Structure template definitions : The standard I/O functions make use of a FILE structure containing information about a file and its associated buffer. The stdio.h file holds the declaration for this structure.

Type definitions : You might recall that the standard I/O functions use a pointer-to-FILE argument. Typically, stdio.h uses a #define or a typedef to make FILE represent a pointer to a structure. Similarly, the size_t and time_t types are defined in header files.

Post your comments here:

Your comments will be displayed after verification.