Welcome to the Interview Questions series on C#. Last week we discussed about "ref" and "out" keywords of C# with suitable example and I hope, that gave you clear understandings about those two parameter type. This week we will discuss about struct and class as few people in Facebook asked me to clarify those two types. In .NET, there are two categories of types available named reference type and value type. The reference typed variables resides in heap and uses pointers to some memory locations whereas the value typed variables resides in the stack as value. Class is reference type and struct is value type. That means, class as a reference type variable contains a pointer or a reference to some memory location where the actual value resides whereas struct as a value type variable contains the entire value. Here is a comparison of class and struct which you can refer: Class Struct A class is...


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,Interview,Interview Questions