In Solidity, when one does inheritance, the two contracts share state. Some pseudocode,
contract A {
uint myVar = 1
setVar() {myVar = 3}
}
contract B is A {
myVar = 2
}
If I deploy A, A.myVar = 1. If I deploy B and then call A.setVar(), B.myVar = 3 (and not 2).
So clearly, inherited contracts share state in Solidity.
In C++, inherited classes do not share state. If you want this kind of shared state functionality, you would need to use the "virtual" key word to reference data in memory (independent of classes).
How can I get "C++ inheritance" functionality in Solidity? For example, if I deploy A, then deploy B, B inherits the functionality of A (namely setVar()) but they do not share state, so A.myVar = 1 and B.myVar = 2 after deployment of both contracts. If I called A.setVar(), B.myVar would still be 2.