jjohn, sanjiv - in C++ its different, not as in C.
I guess, it will make everything simple if you create a matrix template, as in the case of vector templates (which is inbuilt).
refer numerical recipes in C++ source code i have uploaded in the eda upload/download section for the template or skim thro the last few pages for the header file nrutil.h and nrtypes.h in NR in C++ book and construct the template... if you dint know how to construct yourself..
once this is done, you can pass the matrix to the function from the main as in say,
sample_function(mat_a, mat_b, k)
where mat_a and mat_b are matrices and k is some datatype.
and the function declaration will be,
sample_function(mat_IO_DP &mat_a, mat_IO_DP &matb, int k)
here, mat_a and matb can be of any names... and so is k.
and mat_IO_DP is the typecast for the syntax... (as followed in numerical recipes C++)
matrix<double> mat_a;
Its little tedious to create the h file with the template.. but once done, it will be handy in tons of situations trust me... you can also include many other matrix operations in it so that your programming becomes more efficient and economic (saves many lines)!!
good luck,
cedance.