cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
virtual and virtual table
virtual and virtual table
Jun 5, 2010 at 7:48pm UTC
everid
(50)
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.
Jun 5, 2010 at 7:58pm UTC
guestgulkan
(2942)
inline functions are hard-coded at compile time, virtual function calls are decided at runtime
(unless anybody knows differently)
Last edited on
Jun 5, 2010 at 7:58pm UTC
Jun 5, 2010 at 8:12pm UTC
everid
(50)
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?
Jun 5, 2010 at 8:18pm UTC
helios
(17607)
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
Jun 5, 2010 at 9:16pm UTC
Jun 6, 2010 at 1:26am UTC
everid
(50)
thanks.
Topic archived. No new replies allowed.