virtual and virtual table

1. where is virtual table?
is it on the disk, in the object file?
or is it in the memory, in the code segment?

2. if it is in the object file, then why inline functions can not be virtual?

many thanks.
inline functions are hard-coded at compile time, virtual function calls are decided at runtime
(unless anybody knows differently)
Last edited on
Thanks, but where is the virtual table?
in the memory, or in the disk object file?
some materials claim the virtual table is in the object file, in that case, how does vptr to look up the table to find the address?
The virtual table is a static member. It's stored at run time in the same place other static members are stored.
Last edited on
thanks.
Topic archived. No new replies allowed.