I have this array in the class and I need to assign 9*9 number matrix to it.
class puzzle{
int gme[9][9];
}
I know it is not possible to assign an array in c++ with the braze enclosed initialization: Mentioned in this question: c++ array assignment of multiple values
It is possible to use std::copy(newgme, newgme + 3, gme);
and assign the array.
I don't want to do this because we need to assign the array newgme
outside the class and pass this as a parameter to the member function.
Array assignment of multiple values in a class: Which is the best practice?
I would like to set the values to these without using vectors
:
0,0,7 ,0,0,0 ,4,0,6,
8,0,0 ,4,0,0 ,1,7,0,
0,0,0 ,3,0,0 ,9,0,5,
0,0,0 ,7,0,5 ,0,0,8,
0,0,0 ,0,0,0 ,0,0,0,
4,0,0 ,2,0,8 ,0,0,0,
7,0,4 ,0,0,3 ,0,0,0,
0,5,2 ,0,0,1 ,0,0,9,
1,0,8 ,0,0,0 ,6,0,0