Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!pyrdc!gmu90x!dolqci!vrdxhq!umd5!brl-adm!adm!ultra!wayne@ames.arpa From: wayne@ames.arpa Newsgroups: comp.lang.c Subject: Second question on #define Message-ID: <10104@brl-adm.ARPA> Date: Mon, 2-Nov-87 12:04:14 EST Article-I.D.: brl-adm.10104 Posted: Mon Nov 2 12:04:14 1987 Date-Received: Sat, 7-Nov-87 07:20:29 EST Sender: news@brl-adm.ARPA Lines: 22 Having gotten tremendous response to my last question about #define, I now have another one. I have a large number of manifest constants of the form GREATBIGLONGPREFIX_SHORTTHING I would like to have a macro accept only SHORTTHING as an argument but use the full constant name in the generated code. I (naively) tried #define WIDGET(x) printf("%d\n", GREATBIGLONGPREFIX_x) but of course this didn't work (didn't substitute x). I guess this is related to a discussion I saw a while back on getting xy out of two separate parameters x and y (that is, concatenation), but I don't remember the results of that discussion well enough to apply it here. Any assistance would as always be muchly appreciated ... Thnx. Wayne Hathaway ultra!wayne@Ames.ARPA Ultra Network Technologies 2140 Bering drive with a domain server: San Jose, CA 95131 wayne@Ultra.COM 408-922-0100