Path: utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!uupsi!grebyn!ckp From: ckp@grebyn.com (Checkpoint Technologies) Newsgroups: comp.lang.c Subject: Re: Macros in ANSI C Message-ID: <1991Mar3.065123.17146@grebyn.com> Date: 3 Mar 91 06:51:23 GMT References: <1172@intelisc.isc.intel.com> Organization: Grebyn Timesharing Lines: 18 In article <1172@intelisc.isc.intel.com> mojy@iSC.intel.com (Mojy Mirashrafi) writes: >In the old C if you wanted to define a macro to convert its parameter to a >char you would write a macro like this: >#define conv(s) 's' >and if you used "conv(X)" in your code you would get 'X'. >In ANSI C the "'" prevents evaluation of the enclosed characters. If you don't need it to result in a constant, you can use: #define conv(s) #s[0] The real answer is, no, you can't use that old trick anymore, and no new trick replaces it. Sorry. -- First comes the logo: C H E C K P O I N T T E C H N O L O G I E S / / \\ / / Then, the disclaimer: All expressed opinions are, indeed, opinions. \ / o Now for the witty part: I'm pink, therefore, I'm spam! \/