C# Structs

tutorial and example
tutorial and example

In C#, Structs are like classes but they are used to create light weight objects like color, Rectangle, etc. Structs are value type unlike classes that are reference type. Using structs is useful if you have data that is not intended to be modified after creation of struct.

Let’s see an example of Structs

Output

C# Struct Example 2: Using Constructors

Output