Message from C, C++ talks
1) why is there using namespace std? this is not a good point to start programming.
2) define max? what the hell man. setting constant values that should be evaluated during compiletime. that's what constexpr are for. and furthermore: max? seriously? thats not a name.
3) why are you looking into an uninitialized variable? thats not a bug, thats not thinking about what you actually want to do.
1) throw out using namespace std and learn where your functions are located in the libs
2) use constexpr instead of macro defs if possible (constexpr int maxAge) consider giving your variables precise names. names matter and expressiveness matters
3) take a pen and some paper and make a graph of your program