I have a constructor for my class Graph:
template <typename T>
Graph<T>::Graph(T ** input)
{
graphData = input;
}
When I tried to crate a new instance of this class using a two dimensional array instead of int**
int intArray[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
Graph<int>* IntGraph = new Graph<int>(intArray);
I've got an error cannot convert parameter 1 from 'int [3][3]' to 'int **
I'm new to c++ and I thought that these types are compatible. Can you please describe me the difference?
EDIT: since this question was marked as a duplicate, I also wanted to ask, what is the best way to convert one of these types into another, or what to use instead without any loss of performance