Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. const int width = 100;
  2. const int height = 100;
  3.  
  4. int **array = new *int[height];
  5. int *data = new int[height * width];
  6.  
  7. for (int x = 0; x < height; ++x) {
  8.     array[x] = &data[x*width];
  9. }
  10.  
  11. array is now accessible through array[0 through 99][0 through 99]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement