Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!umich!umeecs!msi.umn.edu!noc.MR.NET!uc!shamash!hare!dwb From: dwb@hare.cdc.com (dw block x-4621) Newsgroups: comp.sys.mips Subject: C macro expansion problem Message-ID: <28515@shamash.cdc.com> Date: 10 Nov 90 00:43:46 GMT Sender: news@shamash.cdc.com Reply-To: dwb@hare.udev.cdc.com Organization: Control Data Corporation Lines: 20 According to K&R (2nd edition, p.90), the following program should expand the dprint macro by substituting #expr as "x/y" (quotes and all). On the Mips machines, I get the error '#x undefined'. What's wrong??? #include #define dprint(expr) printf(#expr " = %g\n", expr) main () { int x, y; x = 10; y = 2; dprint(x/y); } ------------------------------------------------------------ Dave Block E-mail: dwb@hare.udev.cdc.com Control Data Corp. AT&T: (612) 482-4621