2010/04/08

C++ 동적 2차원 배열

// Declaration
int** Array;

// Initialize
Array = new int* [nRow];
for ( int i = 0 ; i < nRow ; ++i )
Array[i] = new int [nCol];

// Free
for ( int i=0 ; i < nRow ; i++ )
delete [] Array[i];
delete [] Array;




2008/01/08 - [Dev Story/Tips] - vector를 이용한 2차원 동적 배열

<

Original Post : http://neodreamer-dev.tistory.com/406

No comments :

Post a Comment