Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!rpi!crdgw1!camelback!volpe From: volpe@camelback.crd.ge.com (Christopher R Volpe) Newsgroups: comp.lang.c Subject: Re: Question with cpp and token pasting Message-ID: <16265@crdgw1.crd.ge.com> Date: 31 Jan 91 16:39:09 GMT References: <1991Jan30.232740.1697267@locus.com> Sender: news@crdgw1.crd.ge.com Reply-To: volpe@camelback.crd.ge.com (Christopher R Volpe) Distribution: na Lines: 30 In article <1991Jan30.232740.1697267@locus.com>, bringo@locus.com (Bob Ringo) writes: |>Hi, this is probably a simple task, but I haven't figured it out. |>I'd like to do the following: |> |>#define A "Good" |>#define B "Morning" |>#define C /* the concatenation of A and B */ |> |> |>--I tried the following, but it didn't work. |> |>#define paste(x,y) x ## y |>#define A "Good" |>#deifne B "Morning" |>#define C paste(A,B) Is there any reason you can't rely on the compiler's automatic concatenation of adjacent string literals? For example, printf(A B); will print "GoodMorning". |>Bob Ringo |>Locus Computing Corporation |>bringo@locus.com ================== Chris Volpe G.E. Corporate R&D volpecr@crd.ge.com