On Nov 23, 6:31 pm, Guenter Dannoritzer <kratfkryk...@spammotel.com>
wrote:
> Hi,
>
> I have a piece of code that got developed using Microsoft .NET 2003 and
> I try to compile it with g++/gcc 4.1.2.
>
> There is a problem with the string concatenation operator for the
> preprocessor. The following is a piece of code:
>
> #define GET_DOUBLE_PARM_ARRAY(X,N) {X =
> ParmInput->GetDoubleParmArray(#X##"\0",X,N);}
>
> which causes the following error message:
>
> error: pasting ""A_Coeffs"" and ""\0"" does not give a valid
> preprocessing token
>
> when called like this:
>
> GET_DOUBLE_PARM_ARRAY(A_Coeffs, ar_size);
The preprocessor concatenation operator is used for *token*
concatenation, not *string* concatenation. To concatenate two strings,
one only has to place them next to each other. For instance,
const char *s = "foo" "bar";
std::cout << s << '\n';
|