Note, however, that sizeof is only useful if your array is declared statically. That is, if you use malloc to allocate an array dynamically, then use sizeof on the pointer that is returned, you'll always get 4, which is the number of bytes in a pointer.
In C, the bookkeeping of array/matrix sizes is left largely up to the programmer. You'll notice that many functions that take array arguments (for reading or writing) also take an extra length argument because there is no way to tell the length from just the array alone. So if you have to write functions that pass around arrays/matrices, have them take in the length/dimensions as well.
Hope this helps.
Mert A.
National Instruments