home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / c / 11521 < prev    next >
Encoding:
Text File  |  1992-07-23  |  868 b   |  35 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!usc!cs.utexas.edu!sun-barr!ames!agate!linus!progress!briggs
  3. From: briggs@progress.COM (Scott Briggs)
  4. Subject: Re: Concatenation of two macros?
  5. Message-ID: <1992Jul23.152318.8369@progress.com>
  6. Sender: usenet@progress.com (Mr. Usenet)
  7. Nntp-Posting-Host: phanerozoic
  8. Organization: Progress Software Corp.
  9. References: <1FE7B81211DF800725@ursula.lucas.lu.se>
  10. Date: Thu, 23 Jul 1992 15:23:18 GMT
  11. Lines: 22
  12.  
  13. KOSU_MATSB@ROUTH.KOSUFY.LU.SE writes:
  14.  
  15.  
  16. >    Concatenation of two macros. Is it possible?
  17.  
  18. >    If i have the following two definitions:
  19. >        #define A pre
  20. >        #define B post
  21. >    And want to "#define C" to be  "prepost" BUT as an 
  22. >    expression of A and B! How do i do it?
  23. >    #define C (expression of A and B to yield prepost)
  24.  
  25. Depending on the compiler one of the following should work:
  26.  
  27. #define C A##B
  28.  
  29.   or
  30.  
  31. #define C A/**/B
  32.  
  33.  
  34. Scott.
  35.