CompuServe Thread

DICE

4 messages in this thread
#118392From: Rick NelsonAug 30, 1990 11:28 PM
? I'm using DICE and having problems getting the PreProcessor to echo arguments, like from _The_C _Puzzle_Book_: #define PRINT(int) printf("int = %d\n",int) produces 00000000 = 3 rather than x | y & z = 3 when given PRINT( x | y & z ); in the main program. I was wondering if I was doing something wrong or if this a problem with the DICE preprocessor. Any help or suggestions would be appreciated. <Rick? [A\exit
#118419From: SyndesisAug 31, 1990 9:20 AM
It's a problem in your understanding of the preprocessor. 🙂 Your macro expands to 'printf("int = %d\n", x | y & z )', which turns into what you saw when you ran the program. The 'int' in the "int = " string doesn't get substituted because it's in a string. It turns out C isn't very good at this kind of macro, one that wants to turn tokens into strings.
#118513From: Betty Clay/SYSOPAug 31, 1990 11:05 PM
Rick, I don't think Matt Dillon is ever on CIS. I hope some of our other C programmers will help with your problems, but if you want to locate Matt himself, you will probably need to write to him. His address is in the docs. .Betty
#119032From: Rick NelsonSep 4, 1990 12:22 PM
Thanks, maybe I can reach him on UseNet. <Rick?