Memory allocation in C. 2D version.