Language/C&C++
Using allocated memory like 2-D array.
yhcting
2013. 7. 10. 16:12
int (*arr)[SZ] = (int (*)[SZ])malloc(sizeof(int) * SZ * SZ);
이것은 function pointer와 비슷하게 이해하면 되는데...
int(*)[SZ] <=> void(*)(int, char)
int(*arr)[SZ] <=> void (*func)(int, char)
즉
int [SZ] array에 대한 pointer type => int(*)[SZ]
void (int, char) function에 대한 function pointer => void(*)(int, char)