I have a linear array of structs. These are constant structs and is a way of holding a simple table.

Now though I need to add another "column" to the table (another member in the definition of the struct) and I'm wondering if I'd be better using a class rather than a struct.

Since both structs and classes have constructors I'm wondering which is best to store fixed arrays of data?

Someone has pointed out to me that if I ever wanted to pass the struct or class as a parameter to a function then a class would be better. As you point out the struct would get passed as a value, and if the struct got bigger so the passing would become more heavy.

I don't yet want to pass elements of this array to functions, but I may do in the future so I've changed the elements into a class.

As you point out the struct would get passed as a value, and if the struct got bigger so the passing would become more heavy.

This is true, but there's also the question of how heavy the object is and how often it's copied around. If it's not that heavy relative to a reference or you don't pass it often, the performance difference will be negligible.

I have a feeling this struct may grow with the complexity of the program, so I've turned it into a class.

This question has already been answered. Start a new discussion instead.