struct-experiments/structs1.cs - Fields in structs cannot have initializers. | Lecture 4 - slide 11 : 29 Program 1 |
/* Right, Wrong */ using System; // Error: // Cannot have instance field initializers in structs. public struct StructOne{ int a = 5; double b = 6.6; } // OK: // Fields in structs are initialized to default values. public struct StructTwo{ int a; double b; }