   Virtual function question
  Hi,Im trying to make an inherited graphics class in C++ and i was wondering if its possible to make some kind of virtual function that doesnt need a definition in every child classAt the moment i have CGraphicsEntity //(Parnet class)virtual void Render(float, float);CGraphicsEntitySprite//(Child class)void Render(float, float);CGraphicsEntityModel //(Child class)//I dont want that render function here <---I dont want to use that render function here but i cant compile the project without it, is there anyway around it?   
  Does CGraphicsEntity's Render function have a definition?   ;  no   ;  You don't need to define the method in every subclass if the base method is nonabstract. However, if you really mean you don't want that method available at all in the subclass, you're somewhat out of a luck. You could use private inheritance but that is rather a hack in this case. You could also override the method in the child class so that it's a no-op or throws an exception indicating that it shouldn't be called.The root of that problem, though, is that your design is flawed if you really need to remove that function in a subclass, and you shouldn't be using inheritance there in the first place. Can you elaborate more on what you're going for? Then we can offer better alternative suggestions.   ;  Im not even sure if what im trying to achive is possible, im currently trying to convert a project i did in C# XNA to D3D, C# allowed me to do something simular to what u can see below, and im trying to now do it in C++CGraphicsEntity //(Parnet class)virtual void Render(float, float);//Render spritevirtual void Render(Matrix, Matrix);   //Render modelCGraphicsEntitySprite//(Child class)void Render(float, float);  //Render spriteCGraphicsEntityModel //(Child class)void Render(float, float);  //Render model;  You can do that in C++. Just make sure to give the base class a definition for the functions you don't want to override in derived classes.   ;  What are the float and matrix parameters for?Position (Sprite) and Transformation (Model) ?Why do you have these as parameters to the render function?Shouldn't they be attributes of the respective class so you cancall render() without parameters?   ;  Thanks SiCrane, im sure i had already tried that but now it suddenly works! :p   