Hello
I wanna knw d xact meaning of class n struct in .net?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Jun 24, 2014, 11:25 AM EDT
The difference between them is that classes represent reference types and structs represent value types.
A variable of a reference type contains a reference (a kind of pointer) to where an instance of that type resides in an area of memory known as the heap. If the variable doesn't currently refer to such an instance, it contains a null pointer.
In contrast a variable of a value type contains an actual instance of that type, not a pointer to where it's stored.