百度空间 | 百度首页 
 
查看文章
 
C#结构体
2009年04月16日 星期四 上午 10:12

声明结构体
struct abc
{
public string abc1;
public string abc2;
}
struct xyz
{
public string xyz1;
public string xyz2;
public abc a;
}


实例化
xyz x = new xyz();
x.xyz1 = "";
x.xyz2 = "";
x.a.abc1 = "";
x.a.abc2 = "";


class   test
{
static void Main(string[] args)
{
      xyz x = new xyz();
      x.s3 = "";
      x.s4 = "";
     x.a.s1 = "";
     x.a.s2 = "";
}
}

struct abc
{
public abc(int i)
{
      c1 = new char[4];
      s1 = "";
      s2 = "";
}
public char[] c1;
public string s1;
public string s2;
}
struct xyz
{
public string s3;
public string s4;
public abc a;
}


类别:asp.net‖c#‖vb.net | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu