🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2040

Re: Macro substitution in character literals

#2040
From: Doug Gwyn
Date: Fri, 07 Dec 1990 19:50
13 lines
1100 bytes
In article <11323@pt.cs.cmu.edu> mbj@natasha.mach.cs.cmu.edu (Michael Jones) writes:
>Is there an equivalent for character literals?

There is no analogous "charize" operator.  It was deemed to be significantly
less useful than "stringizing", and did not have enough supporters to make
it into the standard.

About the only place I've seen an attempt at charizing is in a CTRL(c) macro
in some Berkeley code.  They were told not to do that long ago, but didn't
listen.  (CTRL('z') would have been a better design than CTRL(z).)

If you're desperate, you might try
	#define chr(c) #c[0]
Technical Details
Message-ID: <14683@smoke.brl.mil>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!uunet!snorkelwacker.mit.edu!hsdndev!cmcl2!adm!smoke!gwyn
References: <11323@pt.cs.cmu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!uunet!snorkelwacker.mit.edu!hsdndev!cmcl2!adm!smoke!gwyn
From: gwyn@smoke.brl.mil (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: Macro substitution in character literals
Keywords: Macro substitution, C preprocessor
Message-ID: <14683@smoke.brl.mil>
Date: 7 Dec 90 19:50:48 GMT
References: <11323@pt.cs.cmu.edu>
Organization: U.S. Army Ballistic Research Laboratory, APG, MD.
Lines: 13