c++ - How to concatenate strings in a header? -
c++ - How to concatenate strings in a header? -
i want define bunch of constants in dedicated header file.
since prefixes occur quite frequently, want define them 1 time , add together them whenever it's needed.
my question is:
how can concatenate prefix string without space?
example:
#define prefix "pre_" #define keyword "keyword" #define both prefix+keyword
desired result both: pre_keyword
obviously + in
both prefix+keyword
will not work. how can these tokens concatenated?
just
#define both prefix keyword
would it.
adjacent literals automatically concatenated, so
"pre_" "keyword"
would become
"pre_keyword"
c++ header
Comments
Post a Comment