Apr 10, 2012 at 12:55am Apr 10, 2012 at 12:55am UTC
you can create them in the constructor of the class
Apr 10, 2012 at 5:32am Apr 10, 2012 at 5:32am UTC
How do i set the value to random? I understand i should put int milk; under public?
Apr 10, 2012 at 9:51am Apr 10, 2012 at 9:51am UTC
Public member variables are not the same as a global variable.
Situation1 is a member function of adventure so you have to define the function as
void adventure:: Situation1()
on line 25.
The main function should not be member of any class. You can create an adventure object in main and call its functions from there.
Last edited on Apr 10, 2012 at 9:53am Apr 10, 2012 at 9:53am UTC
Apr 11, 2012 at 12:12am Apr 11, 2012 at 12:12am UTC
I get an error saying situation1 cannot be re declared