Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!rochester!pt.cs.cmu.edu!natasha.mach.cs.cmu.edu!mbj From: mbj@natasha.mach.cs.cmu.edu (Michael Jones) Newsgroups: comp.std.c Subject: Macro substitution in character literals Keywords: Macro substitution, C preprocessor Message-ID: <11323@pt.cs.cmu.edu> Date: 7 Dec 90 15:40:28 GMT Organization: Carnegie-Mellon University, CS/RI Lines: 13 How can I write a macro which produces a character literal containing a macro parameter? I'd like to be able to write something like: #define chr(c) 'c' /* Yes, this is incorrect */ which for chr(z) produces 'z' To do this for strings, I know I can write: #define str(s) # s Is there an equivalent for character literals?