不要骂人 不是INT是 intint [][] i = {{1,3,4,5},{2,5,3},{2,3}};
int x[][] = new int[2][3] ;for(int i=0;i<x.length;i++) for(int j=0;j<x[i].length;j++) x[i][j] = i + j ;
我在DREAMWEAVER中引入JAVASCRIPT, 在里面怎么定义多维数组呀?
晕倒,倒底是javascript,还是jsp?
Use a multidimensional array // create 5x5 two dimensional array var multidimension = new Array(5); for ( var i=0; i lt; multidimension.length; i++ ) multidimension[i] = new Array(5);// access first element multidimension[0][0] = "hello world"
to skyyoung:其实你昨天的中文名字还是蛮好看的。
老大,就是不行呀, 根本不认识array[1][2]这种下标。
<html><head> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0"> <title>Untitled Normal Page</title> </head><body bgcolor="#FFFFFF"> <script> function a() { var multidimension = new Array(5); for ( var i=0; i< multidimension.length; i++ ) multidimension[i] = new Array(5); multidimension[0][0] = "hello world" ; alert(multidimension[0][0]); } </script><p><input type="button" onclick="a()"> </p> </body> </html>
老大,how could I initialize the array once for all! I declare a multiarray named selected[4][4] then initialize it like this: selected=("false","false","false","false", "false","false","false","false", "false","false","false","false", "false","false","false","false",); what's wrong with it? why I always encounter a damned error??
var selected = (new Array("false","false"), new Array("false","false"), new Array("false","false"), );
不要骂人
不是INT是 intint [][] i = {{1,3,4,5},{2,5,3},{2,3}};
for(int j=0;j<x[i].length;j++)
x[i][j] = i + j ;
在里面怎么定义多维数组呀?
// create 5x5 two dimensional array
var multidimension = new Array(5);
for ( var i=0; i lt; multidimension.length; i++ )
multidimension[i] = new Array(5);// access first element
multidimension[0][0] = "hello world"
根本不认识array[1][2]这种下标。
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Untitled Normal Page</title>
</head><body bgcolor="#FFFFFF">
<script>
function a()
{
var multidimension = new Array(5);
for ( var i=0; i< multidimension.length; i++ )
multidimension[i] = new Array(5);
multidimension[0][0] = "hello world" ;
alert(multidimension[0][0]);
}
</script><p><input type="button" onclick="a()"> </p>
</body>
</html>
// Arrays within arrays:var x = new Array(new Array(1,2,3),new Array('A','B','C'),new Array('x','y','z'));alert(x[1][2]); // returns 'C'// Associative arrays:var myArray = new Array();
myArray['00'] = 1;
myArray['01'] = 2;
myArray['02'] = 3;
myArray['10'] = 'A';
myArray['11'] = 'B';
myArray['12'] = 'C';
myArray['20'] = 'x';
myArray['21'] = 'y';
myArray['22'] = 'z';alert(myArray['1' + '2']); // returns 'C';
//--></SCRIPT>
I declare a multiarray named selected[4][4]
then initialize it like this:
selected=("false","false","false","false",
"false","false","false","false",
"false","false","false","false",
"false","false","false","false",);
what's wrong with it?
why I always encounter a damned error??
new Array("false","false"),
new Array("false","false"),
);