0

Hello all,

I would be grateful for some help with a function template problem.

I cannot figure out how to pass a matrix as an argument in a template function. I keep getting the error "does not match any template declaration". Can anyone suggest what my problem is? Have I written the argument incorrectly?

I have:

```
template <typename T>
void showMatrix(T** someMatrix)
{
// stuff to do
}
```

Here's how I call it:

`showMatrix( myMatrix );`

The reason I need to pass the matrix as templatized is that I have a class for creating matrices (class Matrix) and I ALSO have matrices that are created as dynamic arrays, for example:

```
double ** matrix;
matrix = new double *[xDimension];
for (i = 0; i < xDimension; i ++)
matrix[i] = new double *[yDimension];
```

myMatrix (the one I use in my main() function call) is a dynamic array.

Thanks a lot.

*Edited 6 Years Ago by RobBobSmith*: n/a