Fredrik Eriksson <fe79}--at--{yahoo}--dot--{com> wrote:
> > Is #include supposed to work just like a textual include?
> Yes.
With two minor exceptions:
1) Certain compiler-dependent #pragmas may change the behavior of #include
slightly. The most common one is "#pragma once".
2) __FILE__ will expand to the name of the header file if it appears in
it, rather than the source file where it's #included. Likewise for __LINE__.
Thus if either identifier is used in a header file, its behavior will be
different than if you copy-pasted the contents of the header file to the
source file.
(The exception is if either identifier is used in a preprocessor macro, in
which case they are interpreted only after expanding the macro instantiation.)
--
- Warp
Post a reply to this message
|