0

I have a c++ project, is it possible to define a macro in the project that affects the text files in the project as well. So to have in the c++ something like "#define ANIMAL dog"

Text File: Good ANIMAL

c++ reads in the text file as: Good dog

Since the text files wouldn't be compiled I wouldn't think there'd be a way, but any help would be appreciated!

Danny
  • 35
  • 5

1 Answers1

1

define macros are read by the preprocessor (part of the compiler). But your text files aren't typically processed by the preprocessor.

However, this answer might be helpful to you:

Stack Overflow Question on Running Preprocessor

Joseph Larson
  • 8,530
  • 1
  • 19
  • 36