You have to be extremely careful when using multiple inheritance.
It's generally accepted that you should not multiply inherit implementation. However, flavours/mixins are a legitimate pattern, and there are other patterns that use it.
Having said all that, I still can't see why you need to cast. I'm not so sure about the design. I would probably like to see the UML class diagram, but that's clearly not necessary here.
RS_A doesn't have a member called values so that does not work. If you want s to point to something that is not a RS_A object why do you make s type RS_A*?
RS_A doesn't have a member called values so that does not work. If you want s to point to something that is not a RS_A object why do you make s type RS_A*?
I could have declared it as a void pointer, but the problem would still exist, no?
I made it RS_A because they are all of type RS_A... its the one struct they all share.
Why doesn't casting a pointer, as a struct the class inherits from, find elements within it when multiple inheritance is used?
Your code fails to compile without the cast because the compiler is telling you that you have done something wrong. And you are. RS_A doesn't have a member value and pretending it does with a cast won't make it true.
You're attempting to override the compiler's static type checking, and if you succeed, you'll have a run time crash.
I can't get my head around why casting a pointer would make such a difference. Surely its just a pointer (with type info). Why does casting it not just make it the appropriate pointer type???