Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int width = 100;
- const int height = 100;
- int **array = (int**)malloc(sizeof(int*)*height);
- int *data = (int*)malloc(sizeof(int)*width*height);
- for (int x = 0; x < height; ++x) {
- array[x] = &data[x*width];
- }
- array is now accessible through array[0 through 99][0 through 99]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement