If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

AFAIK, there should be no difference between the two approaches, but I need to be 100% sure I'm not breaking anything. I'm particularly worried about things like operator precedence. What exactly does the standard say about things like "A" "B" "C"? Are they, for all intents and purposes, as good as a single string, or are they a single string tied via a concatenation operator... ? Are there any risks if someone gets fancy embedding the macro inside chained operators (eg: ? ?

Or, would there be some pre-pro magic I do not know of that could generate my string with a single pair of double quotes?

Is your question related to IO?
Read this C++ FAQ LITE article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.

Re: Pasting "-" does not give a valid preprocessing token

according to the standard, the concatenation of string literals has its own translation phase (6th) occuring after macro expansion but before unit translation. So, at least standard-wise, they are equivalent with respect to code behavior, but they may be not with respect to macro expansion. For example,

Re: Pasting "-" does not give a valid preprocessing token

Originally Posted by superbonzo

according to the standard, the concatenation of string literals has its own translation phase (6th) occuring after macro expansion but before unit translation. So, at least standard-wise, they are equivalent with respect to code behavior, but they may be not with respect to macro expansion. For example,

Ah... Now THERE is a good solution... Unfortunately, I gave you a reduced use case. Inside actual code, the "-" is (potentially) at call site:

Code:

std::cout << QUOTE2(hello, -world);

Is your question related to IO?
Read this C++ FAQ LITE article at parashift by Marshall Cline. In particular points 1-6.
It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.