This is what the problem looks like:
Code: Select all
class g_element
{
protected:
int x, y;
public:
g_element(int _x, int _y){x = _x; y = _y;}
};
Code: Select all
class g_button : public g_element
{
private:
int w, h;
public:
g_button(int _x, int _y, int _w, int _h){x = _x; y = _y; w = _w; h = _h;}
void Handle();
void Draw();
};
Code: Select all
for(int i=0;i<element.size();i++)
{
element[i].Handle();
}
And well i know that g_element has no function named Handle(), but if i add one it gives me an error.
Also all objects in element are != g_element and all other classes should have the function Handle().
Im having a problem, i think its related to virtual functions but i dont know, i wish you guys could help me, thanks.