I was trying to read a file in compile time. My code is as below
#define STR(x) #x
const char *fileContent = STR(
#include "config.txt"
);
The content of config.txt is
ABC
DEF
What my expected value of fileContent is
ABC
DEF
but I got the
#include "config.txt"
for fileContent.
It seems the order of replacing symbol in visual c++ is #define
then #include
.
Can I change the order to #include
then #define
?
Or any suggestion for reading file to char* in compile time ?