function struct(){
this.a = null;
this.b = null;
this.c = null;
}var st1 = new struct();
st1.a = "a";
st1.b = "b";
st1.c = "c";
var st2 = new struct();
st2.a = "d";
st2.b = "e";
st2.c = "f";var arr = new Array(st1, st2);for (i=0; i<arr.length; i++)
{
var print = "st" + i + ".a = " + arr[i].a + "\n";
print += "st" + i + ".b = " + arr[i].b + "\n";
print += "st" + i + ".c = " + arr[i].c + "\n";
alert(print);
}
this.a = null;
this.b = null;
this.c = null;
}var st1 = new struct();
st1.a = "a";
st1.b = "b";
st1.c = "c";
var st2 = new struct();
st2.a = "d";
st2.b = "e";
st2.c = "f";var arr = new Array(st1, st2);for (i=0; i<arr.length; i++)
{
var print = "st" + i + ".a = " + arr[i].a + "\n";
print += "st" + i + ".b = " + arr[i].b + "\n";
print += "st" + i + ".c = " + arr[i].c + "\n";
alert(print);
}
function a(val1)
{
this.b = val1;
}
var ary = new Array;
ary[ary.length] = new a('a');
ary[ary.length] = new a('b');alert(ary[0].b);
alert(ary[1].b);
</SCRIPT>
int nTest[10];
之类的形式。
如果照上面的说法,岂不是要这样:
int n1 = new int();
int n2 = new int();
int n3 = new int();
...
int n10 = new int();int nTest =