Sunday, October 5, 2008

Interview Question Of The Day

The easiest of those I did not answer today was 'What is the difference between a class and a struct?'.

Yes, everyone should know it. For explanation why I did not, refer to the title of this blog. Later I found quite a detailed answer here:

Difference between class and struct in C#

I knew some of these, but did not realize there are that many. Some can be combined though, for example "When you instantiate a class, it will be allocated on the heap.When you instantiate a struct, it gets created on the stack" is obvious if you already know that "Classes are reference types and structs are value types".

by . Also posted on my website

No comments: