getting the matrix

Hi. I need to store the model matrix in an array or any other structure. I’ve read about using glGetFloatv() with GL_MODELVIEW_MATRIX as argument but i don’t know exactly how does it work.

Could anyone write a small example using this function to store the matrix?

Thanks in advance.

typedef float TMatrix[4][4];

TMatrix mv;
glGetFloatv(GL_MODELVIEW_MATRIX,&mv[0][0]);

Thanks mikeman