Easy but easy to make syntax error - Array,Struct

//Declare

char[] chTest  = new char[10];
int[] iTest = new int[10];
string[] strTest = new string[10];

//Value

chTest[0] = 'A';

iTest[0] = 1;

strTest[0] = "Test";

 

//Struct

public struct strTest

{

     public int iTest;

  public char chTest;

  public string strTest;

}

//

strTest strYouWillUse = new strTest;

strYouWillUse.iTest = 1;

strYouWillUse.chTest = 'A';

strYouWillUse.strTest = "Test";

 

posted on 2010-06-13 09:19  我和我自己  阅读(130)  评论(0编辑  收藏  举报

导航