本帖最后由 许杰 于 2013-12-1 15:24 编辑
enum Gender
{
男,女
}
代码:
public struct Person
{
public string name;
public Gender sex;
public int age;
}
public class Program
{
static void Main(string[] args)
{
Person person;
person.name = "张三";
person.sex = Gender.男;
person.age = 25;
Console.WriteLine("请显示他们的信息{0},{1},{2}岁", person.name, person.sex, person.age);
Console.ReadKey();
}
}
报错:
|