1877
A
1878 A preprocessing directive of the form
# include < h-char-sequence > new-line
searches a sequence of implementation-defined places for a header
identified uniquely by the specified sequence between the
1879 How the places are specified or the header identified is implementation-defined.
1880 A preprocessing directive of the form
# include " q-char-sequence " new-line
causes the replacement of that directive by the entire contents of
the source file identified by the specified sequence between the
1881 The named source file is searched for in an implementation-defined manner.
1882 If this search is not supported, or if the search fails, the directive is reprocessed as if it read
# include < h-char-sequence > new-line
with the identical contained sequence (including
1883
144) As indicated by the syntax, a preprocessing token shall not
follow a
1884 However, comments may appear anywhere in a source file, including within a preprocessing directive.
1885 A preprocessing directive of the form
# include pp-tokens new-line
(that does not match one of the two previous forms) is permitted.
1886
The preprocessing tokens after
1887 (Each identifier currently defined as a macro name is replaced by its replacement list of preprocessing tokens.)
1888 The directive resulting after all replacements shall match one of the two previous forms.145)
1889
The method by which a sequence of preprocessing tokens between a
1890
The implementation shall provide unique mappings for sequences
consisting of one or more letters or digits (as defined in 5.2.1)
followed by a period (
1891 The first character shall be a letter.
1892 The implementation may ignore the distinctions of alphabetical case and restrict the mapping to eight significant characters before the period.
1893
A
1894
EXAMPLE 1
The most common uses of
#include
#include "myprog.h"
1895
EXAMPLE 2
This illustrates macro-replaced
#if VERSION == 1
#define INCFILE "vers1.h"
#elif VERSION == 2
#define INCFILE "vers2.h" // and so on
#else
#define INCFILE "versN.h"
#endif
#include INCFILE
1896 Forward references: macro replacement (6.10.3).
1897 145) Note that adjacent string literals are not concatenated into a single string literal (see the translation phases in 5.1.1.2);
1898 thus, an expansion that results in two string literals is an invalid directive.
Next
Created at: 2005-06-29 02:19:04
The text from WG14/N1124 is copyright © ISO