James Kanze
11/6/2008 8:36:00 AM
On Nov 5, 9:06 pm, Bing <bing.j...@gmail.com> wrote:
> Is there a way to define a macro that may contain #include
> directive in its body. If I just put the "#include", it
> gives error C2162: "expected macro formal parameter" since
> here I am not using # to concatenate strings. If I use "\#
> include", then I receive the following two errors:
> error C2017: illegal escape sequence
> error C2121: '#' : invalid character : possibly the result of a macro
> expansion
> Any help?
No. After expansion, "the resulting completely macro-replaced
preprocessing token sequence is not processed as a preprocessing
directive even if it resembles one" [§16.3.4/3]. In other
words, even if there were a way of introducing a sequence
"#include" in the expansion, it wouldn't be an include
directive.
What problem are you trying to solve with this?
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34