You might consider looking into putting the matrix elements onto the heap with malloc -- that way you won't limit the matrices to MAX_ELEMENTS and you also won't waste lots of space for small matrices.<p>It'll complicate the usage a bit (you'll have to add allocate and free functions) but it's a good pattern to learn.