Because the type of object pointed to by the Cat pointer is not determined at compile-time, the decision as to which branch to take cannot be decided at compile-time.
I really want to know why is that so ?
I mean If all the the virtual function has been overriden in derived class then why does it need room for a pointer to a function. Basicly there could only be 1 possiblity.
You have to decide what paradigm you're using; procedural programming, abstract data types, object oriented programming.
Once you've decided what parts of the program are using what, you have to follow the rules of that paradigm. If you are not doing object oriented programming, then don't do it.
The vtable mechanism is part of the object oriented support in C++. If you're not using OO, you won't be using such things.
I have a class which is inherited trough so many class. Let's say I have a class that have 50 virtual function. That makes it 200 Byte big without anything else... Let's call it "Cat"
All the function from the where Cat has inherit has been overriden.
suppose anywhere in the code there won't be other than
Each object instance has at most one pointer to the virtual function table of its class. You're not wasting any memory.
Besides, if you think you don't need virtual functions, then just don't use them.