   C++ help
  I've been reading C++ tutorials for the past two days w/o finding an answer to my problem.Class A{void CallMe();//A methodB b; //A B class};Class B{    Function();};B::Function(){CallMe();//This doesn't work!}So basically: How can I have class B access Its parents class's methods?And if I can't do that what should I do instead? A global pointer to class A? Passing the address of class A to class B?Some more info:My game has a "superclass" simply called Game. In this class there's a System class, and a Play class derived from an abstract GameState class.The Play Class needs to know what buttons are pressed, and this info is in System.GetKeyState(SDLKEY key).Thanks for reading my long post! :)Hope this is an ok forum to post this.   
  Well of course it doesn't work, all you've done is make an instance of B called b within the A class. Even b still doesn't have access to A. It's been a while since I used C++ but I think you have two options here:Use A as a base class for Bclass A{void CallMe();}class B : A{    void Function();};B::Function(){CallMe();}or have B take a pointer to an A instanceclass A{void CallMe();}class B{    A* A_Pointer; // be sure to actually set this so it isn't null    void Function();};B::Function(){A_Pointer->CallMe();}Also rather than using a "superclass" you may want to create a singleton or static class, or just use a namespace.;  You might want to post actual code that you are using, it would make it more clear what you are asking. For example, when you say you have a System class in your Game class, do you mean Game contains an instance of an object of type System, or do you mean that System is a nested type inside Game?   ;  Make sure CallMe() is protected or public.  C++ classes default to private, which will make it unavailable from any derived classes.   ;  Woo, fast replies!SiCrane:I can't post the actual code right now because my brothers using that computer,But I do indeed mean an instance.Visage:I know about the different access types, I was just writing a quick example and forgot them.Scet:Ok, that really clears up what I can and can't do, thanks for the information!Thanks for the help everyone. I think I can handle it from here.In OO programming I always feel like I'm coding myself into a hole :O   