public class Answer
{
public Answer(string p, bool c)
{
Prompt = p;
Correct = c;
}
public string Prompt;
public bool Correct;
}
Printable View
public class Answer
{
public Answer(string p, bool c)
{
Prompt = p;
Correct = c;
}
public string Prompt;
public bool Correct;
}
This is VC++ board. You are posting in the wrong forum again. This is right place for C# questions.
[ Moved thread ]
Two ways.
Using 'regular' properties:
Using autoproperties:Code:public class Answer
{
public Answer(string p, bool c)
{
Prompt = p;
Correct = c;
}
public string Prompt
{
get { return _prompt; }
private set { _prompt = value; }
}
public bool Correct;
{
get { return _correct; }
private set { _correct = value; }
}
private string _prompt;
private string _correct;
}
Code:public class Answer
{
public Answer(string p, bool c)
{
Prompt = p;
Correct = c;
}
public string Prompt { get; private set; }
public bool Correct { get; private set; }
}