I hope my terminology is correct here, still learning all the right lingo.
I’ve created a custom class using the following code:
public class inputData
{
public string type;
public int time;
public int score;
public int height;
}
And I’d like to create a list that contains that class, as I’ve done here:
List<inputData> inputList = new List<inputData>();
I’m now trying to Add to that list and I’m having trouble. I’ve tried both of the following and still no luck. Can someone point me in the right direction here?
inputList.Add(new inputData("1", 2, 3, 4));
inputList.type.Add("1");
You need object initializer
Change
To