C#C
C#2y ago
84 replies
המשורר

C# array init

if I initialize an array of structs, which constructor does it use if any?
MyStruct[,] array = new MyStruct[2, 3];

struct MyStruct {
  public MyStruct() {
    // ctor
  }
  
  public MyStruct(int x) {
    // another ctor
  }
}
Was this page helpful?