Usually play with games, but I'm going to combine a few questions and answers for educational purposes.
In any case, I have a class of questions that contains many members: the question itself, the answer to the question , an array of possible answers, etc. There is no doubt that this should be a class.
However, my response class only contains a string, an Enum number, and an int id, as shown below:
public class Answer { public string Answer { get { return answer;} private set { answer = value; } } public Answer_Category = Some_Value;
Ok, so it contains two lines as well as ctor.
So, should I make this a structure? I ask how this seems comparable to creating Vector a struct, which is such a small data structure "n all".
Naturally, as a question and answer, the answer of the class / structure will be the subject of many search calls.
IMO it should be a structure - just because of the size of the structure, have not played with C # for some time, although it was just looking for some explanation.
c # struct class
Lee brindley
source share