Hi, I am coding in C# I have a class. say class Flower and I have a structure say struct petals now this structure contains some reference types namely lists. I want to create a new Flower Object how will I initialize the list? Is this the correct way to do? Flower rose = new Flower(); Petals myPetals = new Petals(); rose.myPetals = myPetals.Initialize(); //Now myPetals does have an initialized struct variable but // is this how I am supposed to even to do this? class Flower { Petals myPetals; } struct Petals { public list WeatherInputs; public Petals Initialize { myObject = new List; return this; } }
Will mark are resolved once you answer :)