Quote Originally Posted by Russco View Post
Whilst strictly speaking this is allowed.....
Code:
#define maxrand 40
#define maxrand2 50
It is never a good idea to use macro's to represent constants. The much more correct way would be....
Code:
const int maxrand = 40;
const int maxrand2 = 50;
Use the preprocessor as little as possible. There are some things you have to use it for, but for constants and inline functions it shouldn't be used.
What are you basing that on? The first line in MSDN's documentation for #define says "You can use the #define directive to give a meaningful name to a constant in your program", and they do it all over the place.