Well, the primitive types are a special case - but yes, if you want to
initialize a struct, you generally need to call a constructor.
I guess I was just looking for something as simple as what you can do
with initializing an array:
int[] x = new int[] { 4, 5, 6, 7 };
If it's
a mutable struct (generally a bad idea) you *could* just do:
MyStruct x;
x.SomeProperty = ...;
but it's generally better to have a constructor which fully constructs
the struct, and call that.
Yes, I think I need a constructor. I did notice that C# complains if
you only initialize a portion of the fields in the struct (if you miss
one) and then attempt to use it. So, it is safe (perhaps not so in
earlier versions?). But, a c'tor seems more safe.
A mutable struct is a bad idea? What is a mutable struct? I know
mutable means it can change. But, unless all fields are private,
isn't the struct mutable? Or is this precisely what you mean, that
struct fields should all be private (almost like a class)?
Zytan