using UnityEngine;

using System.Collections;


public class chap10_6 : MonoBehaviour {


// Use this for initialization

void Start () {

/*

int[][] jagged = new int[3][];

jagged[0] = new int[5]{1, 2, 3, 4, 5} ;

jagged[1] = new int[5]{10,20,30} ;

jagged[2] = new int[5]{100,200} ;

*/

int[][] jagged2 = new int[2][] {

new int[]{1000, 2000} ,

new int[]{4, 5, 6, 7}

} ;

foreach(int[] arr in jagged2){

for(int i = 0; i < arr.GetLength(0); i++){

print(string.Format("arr[{0}] = {1}", i, arr[i]));

}

}

}

// Update is called once per frame

void Update () {

}

}



'Computer Language > 유니티' 카테고리의 다른 글

바둑게임 선생님 일차!  (0) 2014.05.19
바둑돌  (0) 2014.05.16
다차원 배열  (0) 2014.05.16
시험 예제  (0) 2014.05.16
이차원 배열 getUpperBound []<- []  (0) 2014.05.16

+ Recent posts