home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20187 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  1.0 KB

  1. Path: sparky!uunet!gatech!udel!darwin.sura.net!spool.mu.edu!olivea!apple!voder!berlioz.nsc.com!desktop!nelson
  2. From: nelson@desktop.nsc.com (Taed Nelson)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Preprocessor question
  5. Keywords: Preprocessor, string
  6. Message-ID: <1993Jan25.213704.23466@berlioz.nsc.com>
  7. Date: 25 Jan 93 21:37:04 GMT
  8. References: <1993Jan25.161425.27962@bnrmtl.bnr.ca>
  9. Sender: news@berlioz.nsc.com (UseNet News account)
  10. Organization: Applications Technology, National Semiconductor (Santa Clara CA USA)
  11. Lines: 14
  12.  
  13. In article <1993Jan25.161425.27962@bnrmtl.bnr.ca>, karim@bnrmtl.bnr.ca (Karim Younes) writes:
  14. > I am trying to have a #defined variable recognized by the
  15. > preprocessor inside a string. In other words, I want to
  16. > do something like this:
  17. > #define JUNK 50
  18. > static char *junk = "JUNK ways to leave your lover."
  19.  
  20. Even though this may look just plain wrong, it will work:
  21.  
  22.     #define JUNK "50"
  23.     static char *junk = JUNK "ways to leave your lover.";
  24.  
  25. I suspect this is in the FAQ, but if it isn't, then it probably should be.
  26.