I have 2 structures, (example) 1 called Woords and the other one called Sentence.
Sentence contains nothing more then a List<> of Woords.
Now when I try to add Woords to the List on Sentence it says "NullReferenceException". Now I can understand that I need to create a New List before adding any items to it, but can't figure out how to do it with the structs.
See sample code below:
// my structs
public struct structWoords
public string woord1;
public string woord2;
public struct structSentence
public List<structWoords> woords ;
myTest.woord1 = textBox1.Text;
myTest.woord2 = textBox2.Text;
Structs.structSentence mySentence = new Structs.structSentence();
mySentence.woords.Add(myWords); // error happens here
// I think the problem is that I don't make a new List but don't know how to do it with the struct...