This page was last modified 13:41, 8 December 2007.
Vtable
From Forum Nokia Wiki
Virtual functions are implemented using a table of function pointers, called the vtable. There is one entry in the table per virtual function in the class. This table is created by the constructor of the class. When a derived class is constructed, its base class is constructed first which creates the vtable. If the derived class overrides any of the base classes virtual functions, those entries in the vtable are overwritten by the derived class constructor. This is why you should never call virtual functions from a constructor: because the vtable entries for the object may not have been set up by the derived class constructor yet, so you might end up calling base class implementations of those virtual functions.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| RVCT compile error | asheeshv | General Symbian C++ | 2 | 2007-04-11 07:17 |
| __declspec(dllexport) error | shaojieli | General Symbian C++ | 3 | 2008-08-23 11:45 |
| release编译不过去的问题 | suisuiaini | Symbian | 10 | 2007-09-05 09:16 |
| Function to determine the datatype. | Priju Jacob Paul | General Symbian C++ | 9 | 2008-02-18 10:01 |
| Resolving .sym file error | sumitv | General Symbian C++ | 5 | 2007-03-14 07:27 |
