I know the how virtual function and dynamic polymorphism works. I konw that compiler will add a v-ptr in the base class which will be inherited by subsequent derived classes. Also that, compiler will create v-tables for each class and will keep the function pointers of most derived version of the virtual functions with respect to each of the classes.
Now, my question here is where does this v-table gets stored? Is it in the code segment? From where memory is allocated for these table(s). Please share the internal details.
I also know that the implementation may vary from one compiler to the other. But one can mention one particular compiler and the implementation specific to that compiler in his/her answer.