I want to do:
#define VERSION XY123
#define PRODUCT MyApplication_VERSION
so that PRODUCT is actually MyApplication_XY123. I have tried playing with the merge operator ## but with limited success...
#define VERSION XY123
#define PRODUCT MyApplication_##VERSION
=> MyApplication_VERSION
#define VERSION XY123
#define PRODUCT MyApplication_##(VERSION)
=> MyApplication_(XY123) - close but not quite
Is what I want possible?
Some common synonyms of combine are associate, connect, join, link, relate, and unite. While all these words mean "to bring or come together into some manner of union," combine implies some merging or mingling with corresponding loss of identity of each unit.
To combine means to join two or more things together into a single unit. When things are combined, they form combinations. Less commonly, combine can also be used as a noun to refer to several different things, especially a grain harvester and an event at which athletes showcase their skills.
To choose the merge option, click the arrow next to the Merge button and select the desired merge option. Once complete, the files are merged. If there are multiple files you want to merge at once, you can select multiple files by holding down the Ctrl and selecting each file you want to merge.
Opposite of to combine or blend together to form one substance or mass. separate. split. divide. unmix.
All problems in computer science can be solved by an extra level of indirection:
#define JOIN_(X,Y) X##Y
#define JOIN(X,Y) JOIN_(X,Y)
#define VERSION XY123
#define PRODUCT JOIN(MyApplication_,VERSION)
The ##
operator acts before argument substitution has taken
place. The classical solution is to use a helper:
#define CONCAT2(a, b) a ## b
#define CONCAT(a, b) CONCAT2(a, b)
CONCAT(MyApplication_, VERSION)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With