public struct s_p
    { public int p;
      public string s;
    }
     public s_p[]  q = new s_p[ 20 ] //你的数据类型没有呀.
      {
        {23, "我"},
        {12, "hh"},
        ........................
      };

解决方案 »

  1.   

    public struct s_p
        { public int p;
          public string s;
          public s_p(int np,string ns)
          {
            p = np;
            s = ns;
    }    }
         public s_p[]  q = new s_p[ 20 ] 
          {
            new s_p(23, "我"),
            new s_p(12, "hh"),
            ........................
          };
      

  2.   

    public struct s_p
        { 
          public int p;
          public string s;
        }
         public s_p[]  q = new s_p[ 20 ] 
          {
            new s_p(23, "我"),
            new s_p(12, "hh"),
            ........................
          };
      

  3.   

    public s_p[]  q = new s_p[ 20 ]
          {
            q[0] = new s_p();
            q[0].p=23;
            q[0].s="我";        q[1] = new s_p();
            q[1].p=12;
            q[1].s="hihi";
            ........................
          };
      

  4.   

    public struct s_p

    public int p;
    public string s;
    }public s_p[]  q = new s_p[ 20 ];
    q[0].p = 23;
    q[0].s = "我";
    q[1].p = 12;
    q[1].s = "hh";
    ........................因为结构的构造函数默认的是空参数的。
    也可以:
    public struct s_p

    public int p;
    public string s;
    public s_p(int p, string s) {
    this.s = s;
    this.p = p;
    }
    public s_p[]  q = new s_p[ 20 ] 
    {
            new s_p(23, "我"),
            new s_p(12, "hh"),
            ........................};