how to get size of 2d array

Started by
1 comment, last by pascalosti 17 years, 9 months ago
how can i get size of array from row and colum seperatly struct Matrix{ float m33[3][3]; float m44[4][4]; } chaos, enchant; int main(){ cout << sizeof(chaos.m33)<< endl; cout << sizeof(chaos.m44)<< endl; cout << sizeof(chaos.m33[0][0])<< endl; return 0; }
Advertisement
float array[x][y]rowsize = sizeof( float ) * xcolsize = sizeof( float ) * ytotalsize = sizeof( float ) * x * yortotalsize = sizeof( array )
Allways question authority......unless you're on GameDev.net, then it will hurt your rating very badly so just shut the fuck up.
isnt there a command that goes something like

sizeof(first ->chaos.m33);

and second

edit
nevermind
I remember thats from the stl library for map or set

This topic is closed to new replies.

Advertisement