Skip to content

Instantly share code, notes, and snippets.

@torokati44
Created June 16, 2014 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torokati44/57ce81df31a58f98b47e to your computer and use it in GitHub Desktop.
Save torokati44/57ce81df31a58f98b47e to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#define SIZE 4096
int main()
{
int *ptr = (int *)malloc(SIZE * SIZE * sizeof(int));
for (int x = 0; x < SIZE; ++x)
{
for (int y = 0; y < SIZE; ++y)
{
ptr[y*SIZE + x] = 42; // egyik
// ptr[x*SIZE + y] = 42; // másik
}
}
free(ptr);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment