Udyant Wig <> writes:
[...]
> #define NDICE 5 /* The number of dice to be rolled. */
> #define SIDES 6 /* Each die has these many sides. */
> #define MAXSUM (SIDES * NDICE) /* The maximum possible sum of NDICE
> dice.
> */
> #define LIMIT ((MAXSUM) + 1) /* This constant is used:
> 0) to declare the array of sums
> 1) as a loop limit
> */
[...]
The inner parentheses in the definition of LIMIT are unnecessary.
As long as MAXSUM is defined properly (which it is), you can
just write:
#define LIMIT (MAXSUM + 1)
In general, you don't need to parenthesize single tokens
(identifiers, constants) in macro definitions.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"