int mBlockGrid[5][5];
int TempGrid[5][5];
.
.
(Code to initialize the TempGrid array)
.
.
//Copy the TempGrid array to the mBlockGrid array
&mBlockGrid = &TempGrid
However, the compiler complains by saying "left operand must be l-value"
I''m not sure what I''m doing wrong. Suggestions?
Copying an Array
In my code, I have two arrays with the same bounds, and I''m trying to copy one to the other.
Hallo......=0)
What you''re doing (or trying to do) there, is like saying
"make this address equal to that address"....which you can''t do....so have a go with this :
//Copy the TempGrid array to the mBlockGrid array
memcpy(mBlockGrid, TempGrid, sizeof(TempGrid));
that should do it....
:o)
What you''re doing (or trying to do) there, is like saying
"make this address equal to that address"....which you can''t do....so have a go with this :
//Copy the TempGrid array to the mBlockGrid array
memcpy(mBlockGrid, TempGrid, sizeof(TempGrid));
that should do it....
:o)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement