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

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -