C code should not access objects that have a virtual base class. The reason is that a virtual base is usually represented in the form of a pointer to a shared instance of the virtual subobject. The position of this pointer among user-defined data members is implementation-dependent. Furthermore, the pointer holds a transient value, which can change from one execution of the program to another. Therefore, accessing an object with a virtual base from C code is highly dangerous and should be avoided.
Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in