The vptr index should display all virtual functions, but in my case only 2 out of 3 virtual functions are displayed.
I provide the full code and screenshots below: -
ClassHeader.h
#include <iostream> using namespace std; // Employee Class class Employee { public : int salary ; Employee(){cout << "Inside CTOR" << endl;} virtual ~Employee() {cout << "Inside DTOR" << endl;} virtual void pay(){cout << "Employee" << endl;} }; // Manager Class class Manager : public Employee { public : virtual void pay(){cout<< "Manager pay" << endl;} virtual void Rank(){cout << "Manager Rank" << endl;} }; // JuniorManager Class class JuniorManager : public Manager { public : virtual void pay(){cout<< "JuniorManager pay" << endl;} virtual void Rank(){cout << "JuniorManager Rank" << endl;} };
main.cpp
#include "ClassHeader.h" void main() { Manager *p = new Manager(); p->pay(); p->Rank(); p = new JuniorManager(); p->Rank(); Employee *pE = dynamic_cast<Employee*>(p); pE->pay(); }
There are two virtual functions in the Manager class, payment and ranking, but only wages are displayed in vptr.
Can someone please tell me why Rank does not appear, although its a virtual function.
I am using Visual Studio 2008 and with the latest updates on the 64-bit version of Windows 7.

JuniorManager Debugger Screenshot
It also does not show virtual functions. See image below.

source share