I am more interested in an answer from the .Net and CLR point of view:
Why a struct can not be a base class of another struct or vise versa?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Structs occupy fixed-size slots in the stack (or wherever they’re living).
Therefore, you wouldn’t be able to do any kind of polymorphism with structs, since the derived struct would be a different size.
It would be possible to inherit members from other structs, but since you wouldn’t be able to do any kind of polymprphism, it wouldn’t be worth the confusion.