I recently posted how to allocate a 2D array here
http://www.go4expert.com/showthread.php?t=7759