Dynamic allocation of multi-dimensional array
Posted 2009/07/04 23:57, Filed under: 분류없음
예를 들어 int a[10][20]을 동적할당으로 만들고 싶다면
int **a;
a = (int **)malloc(sizof(int *)*10);
for (int i=0; i<10; ++i)
a[i] = (int *)malloc(sizeof(int)*20);
Trackback URL : http://8.7lightyears.com/blog/words/trackback/136











