[comp.sys.mips] C macro expansion problem

dwb@hare.cdc.com (dw block x-4621) (11/10/90)

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 <stdio.h>

#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