This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RES: It's possible to use folder/file path for #define (like is possible to use folder/file path into #indude statement) ? If yes, why ?


Hi Luiz,

> #define FOO "my/dir/bar.txt" , means "replace FOO" for text
> "my/dir/bar.txt" or for bar.txt content ?

It means replace the identifier token FOO with the text (including the
quotes) "my/dir/bar.txt".

To insert the contents of "my/dir/bar.txt" into your source code, use:
#include "my/dir/bar.txt"

If FOO is defined as "my/dir/bar.txt", this will also work:

#include FOO

...but doing so is unusual, and not generally recommended.

Note:  these are not GCC particular questions, they are C/C++ questions
(well, really, the C preprocessor itself) that should be asked on a more
appropriate forum.

Sincerely,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]