So, I was playing around with Visual Studio's Test Suite and I discovered something interesting:
I have an instance to class A at address, say, 0x0656a64c
.
Then when I watched over the variable, it says that its __vfptr
is pointing at 0x077e7c0c
.
As far as I know, a class' virtual table pointer should be located in the first 4 bytes (or 8 bytes on 64-bit applications) of the class instance, unless it's a case of multiple inheritance (then it's just offsets of the 1st vtable address).
I observed that Visual Studio compiled my test into a .dll and run its test tools dynamically loading the .dll.
Could this be what's causing the address difference?
Here's a screenshot of the VS debugger