using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace l05
{
enum gender
{
男,
女
}
public struct person
{
public string name;
public gender sex;
public int age;
}
class Program
{
static void Main(string[] args)
{
person oneperson;
oneperson.name = "zhang";
Console.WriteLine("姓名{0}", oneperson.name);
Console.ReadKey();
}
}
}
这里定义了一个玫举和一个结构,但调试时却提示Inconsistent accessibility:field type'l105.gender' is less accessible than field 'l05.person.sex'错误,求高手指点哪里出问题了,怎么解决,谢谢了
GCT1015
相关分类