Skip to content

Instantly share code, notes, and snippets.

@n-eq
Created April 16, 2017 12:40

Revisions

  1. n-eq created this gist Apr 16, 2017.
    19 changes: 19 additions & 0 deletions cachecache.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #include <stdio.h>
    #include <stdlib.h>

    #define N 2000
    #define M 1000

    int t[M][M] = {{0}};

    int main(){
    for (int i = 0; i < N; i++)
    // swap the two lines to observe the effect
    for (int j = 0; j < M; j++)
    for (int k = 0; k < M; k++){
    // printf("t[%d][%d] @ %p\n", j, k, &(t[j][k]));
    t[j][k] = k + j;
    }
    return EXIT_SUCCESS;
    }