What the compiler says is that an array of float t[n][n]
where n
is a compile-time variable [that is, not a constant] does not match float T[][MAX]
, when MAX
is a compile-time constant.
It will probably work fine to use float t[n][MAX]
for your temporary matrix. However, bear in mind that C and C++ does not deal with "variable size arrays" (in particular when passing them from one function to another) very well, and in C++, it would probably be a better idea to use a different way to describe your matrix. For example:
std::vector<vector<float>> t;
You will then need to do some more work to define the size of the vector, for example:
t.resize(n);
for(i = 0; i < n; i++){
t[i].resize(n);