C# Struct versus Class
2008 07 25 – 7:21 amI've been working on an in-house inventory management system for the last few weeks. During the course of the project, I've been faced with a few design decisions that I thought would be nice to share here.As if the title weren't a dead giveaway, I've had to decide on using classes or structs for holding data I intend to output or input. So, basically, I needed a mechanism for hold values that I set once and then output to the screen or input to the database.The main difference between a struct and a class is the type of object they are. A struct is a value type where as a class is a reference type. This means that structs share the behavior of other value types such as int32, DateTime, etc. In effect, a struct will behave like any other variable you declare. Once ...
A professional software developer on the .Net and LAMP platforms.
I enjoy walks on the beach, SQL Server, video games, and college sports.