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.