Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 073d2f2

Browse files
committed
C#: Add some example struct types, including one with a default constructor declarations.
1 parent 547f492 commit 073d2f2

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
3+
// Struct with user declared parameterless constructor.
4+
public struct MyStructParameterlessConstructor
5+
{
6+
public int X;
7+
public readonly int Y;
8+
public int Z { get; }
9+
10+
public MyStructParameterlessConstructor()
11+
{
12+
X = 1;
13+
Y = 2;
14+
Z = 3;
15+
}
16+
}
17+
18+
// Struct with compiler generated parameterless constructor.
19+
public struct MyDefaultStruct { }

0 commit comments

Comments
 (0)