C#: Add some example struct types, including one with a default constructor declarations.

This commit is contained in:
Michael Nebel
2022-01-19 09:26:51 +01:00
parent 547f492be0
commit 073d2f2c75

View File

@@ -0,0 +1,19 @@
using System;
// Struct with user declared parameterless constructor.
public struct MyStructParameterlessConstructor
{
public int X;
public readonly int Y;
public int Z { get; }
public MyStructParameterlessConstructor()
{
X = 1;
Y = 2;
Z = 3;
}
}
// Struct with compiler generated parameterless constructor.
public struct MyDefaultStruct { }