I have had this problem which i keep coming back to, and i have to solve it somehow now
My Main function:
My class:Code:void main(){ Character Luke; Luke.initialise; battle(); }
My function:Code:class Character { public: void initialise(); int get_hp(); private: int hp;
however i get the nice problem that "Luke is undeclared in this function" (the 'battle' function).Code:void battle(){ Luke.get_hp(); };
I of course have several other functions which need to access "Luke.get_hp();" and other modules that i have in the class. So how can i get the "battle" function to be able to see that i have already created the object "Luke" and allow access to it?