Sunday, July 12, 2009

How to make a 2D array in C bigger than 11x11?

I'm writing a program in C that is a text version of a 3D game. The board will be comprised of a rectangular grid of M rows x N columns, where M and N can vary between 6 and 24. I'm using a 2D array (board[i][j]) that shows matrices as big as 11 x 11, but once one of the dimensions goes over 11, it no longer works. What should I do?

How to make a 2D array in C bigger than 11x11?
Your bug has nothing to do with the C language. You can make arrays much bigger than 11x11. So look for the actual bug in your code instead of assuming the compiler or computer is broke.

floral

No comments:

Post a Comment