code_junkie

C++ 2DArray Objects; Pointers and Array Problems

Nov 13th, 2011
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. void Grid::extractArray( int** arr )
  2. {
  3. for(int i = 0; i < xGrid ; ++i) {
  4. for (int j = 0; j < yGrid ; ++j) {
  5. squares[i][j] = arr[i][j];
  6. }
  7. }
  8. }
  9.  
  10. void Grid::extractArray( const Piece & piece)
  11. {
  12. for(int i = 0; i < piece.xGrid ; ++i) {
  13. for (int j = 0; j < piece.yGrid ; ++j) {
  14. squares[i][j] = arr[i][j];
  15. }
  16. }
  17. }
Add Comment
Please, Sign In to add comment