Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!ucsd!sdcc6!sdcc10!bruno From: bruno@sdcc10.ucsd.edu (Bruce W. Mohler) Newsgroups: comp.lang.c Subject: Re: ANSI CPP string concatenation Message-ID: <20832@sdcc6.ucsd.edu> Date: 21 Jun 91 16:01:33 GMT References: <1271@cnw01.storesys.coles.oz.au> Sender: news@sdcc6.ucsd.edu Organization: Pacific*Bell, San Diego, CA Lines: 34 In article fischer@iesd.auc.dk (Lars P. Fischer) writes: >>>>>> On 19 Jun 91, nigel@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@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@sdcc10.ucsd.edu voice: 619-586-2218