Using Visual Studios 2010 C#
so i am making a struct of data for a c# project, that will among it's members include an array of type another struct. So for example here is a stripped down idea of my code:
private struct scores
{
public double finalScore;
};
private struct information
{
public string name;
public scores[] scoreList;
};
I am getting the following warning when I write this:
Error 1 'WindowsFormsApplication1.main.information.scoreList': cannot have instance field initializers in structs
I am wondering what is the correct way to declare the scores[] scoreList aspect of the struct information, so I can have the array size set to 10?
Things I have tried:
If I try
public scores[] scoreList = new scores[10]
I get the following error
Error 1 'WindowsFormsApplication1.main.information.scoreList': cannot have instance field initializers in structs