> #define SIX 1+5
> #define NINE 8+1
> printf("What you get when you multiply SIX by NINE: %d", (SIX * NINE) );
On Fri, 3 Dec 2010, Philip Pemberton wrote:
Which is why you should either bracket arithmetic
operations in macros,
or declare them as 'const' variables:
const unsigned int SIX = 1+5;
#define NINE (8+1)
Whether this is a bug depends on what the code is meant to do. If it's
supposed to give you the answer for 1+(5*8)+1, then it's fine (though
I'd call it bad code because there's a significant potential for
confusion). If you wanted to know what 6*9 was, then you have a
problem...
Just need to know what the QUESTION is.
"The mice
will be furious."
Um, what?
The crash on earth of the Golgafrincham B ark was a horrible cock-up, and
ruined the project. The last iteration of the search for the question
(when Arthur Dent tried to teach a neanderthal to play scrabble) was
"Whatdoyougetwhenyoumultiplysixbynine"
If that is still a "Um, what?":
Douglas Adams
"Restaurant At The End Of The Universe"
(of "Hitchhiker's Guide To The Galaxy")
--
Grumpy Ol' Fred cisin at
xenosoft.com