I read a thread (which had the input of Marc Gravell and Jon Skeet) that mentioned if a struct is in a class, that struct is stored on the heap like the class.
What if a class is a member of a struct? Where does the class get assigned to?
Thanks
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.
If a class is a member of a struct, then only the reference is stored in the struct (i.e. the 32/64-bit address to the instance). The instance of a class is always on the heap.