ANSI CPP string concatenation
Bruce W. Mohler
bruno at sdcc10.ucsd.edu
Sat Jun 22 02:01:33 AEST 1991
In article <FISCHER.91Jun20221733 at galilei.iesd.auc.dk> fischer at iesd.auc.dk (Lars P. Fischer) writes:
>>>>>> On 19 Jun 91, nigel at cnw01.storesys.coles.oz.au (Nigel Harwood) said:
>
>Nigel> Does anyone know if you can append strings in ANSI C.
>
>"The preprocessor operator ## provides a way to concatenate actual
> arguments during macro expansion. [...]
>
> #define paste(front, back) front ## back"
>
> - Kernighan & Ritchie: The C Programming Language, 2.ed, p.90
>
>Found by looking up "concatenate" in the index.
>
>RTFM.
>
>/Lars
>--
>Lars Fischer, fischer at iesd.auc.dk | It takes an uncommon mind to think of
>CS Dept., Univ. of Aalborg, DENMARK. | these things. -- Calvin
What options do I have if my preprocessor does not support "##"?
I've tried having the 2 strings sandwiched between empty comments
("/**/").
Any suggestions?
Bruce
--
Bruce W. Mohler
Systems Programmer (aka Staff Analyst)
bruno at sdcc10.ucsd.edu
voice: 619-586-2218
More information about the Comp.lang.c
mailing list