Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
25 Dec 2012sourabhmehta 3 alternatives
Hi All,I know there are so many existing forums on the same topic. But they are not clear.so my question is..When is the virtual table created in c++ whether compile-time or run-time?In few of the forums it is mentioned that,at compile time only the layout of the table gets created...
This article talks about virtual tables - Polymorphism in C[^]
The compiler already needs to know which function's address is in cell number n of the v-table of a class. Otherwise it couldn't generate code to call that function. So basically the answer to your question is: V-tables are prepared at compile time. So the compiler for instance knows that...
Physics, physical and quantum optics, mathematics, computer science, control systems for manufacturing, diagnostics, testing, and research, theory of music, musical instruments… Contact me:
https://www.SAKryukov.org