Not like c++, the deault access property of the sturct is "private".
try this:
public  int x;
public  int y;

解决方案 »

  1.   

    定义构造函数时不能才用缺省方式(无参数)
    使用new创建的对象回自动调用指定的构造函数
    反之仍会创建对象;但不初始化'struct accout{
    public string name;
    public double balancd;
     public account(string n,double b){
    name=n;
    dalance=b;
    }
    }
    class structdemo{
    publiec static void main(){
    account acc1=new account("tom",1232.22);//显示构造函数 
    //n=tomb=1232.22
    account acc2=new account();//缺省函数 n=null/0  b=null/0
    account acc3;//没有构造函数 必须手工初始化