Issue with a multi dimensional array in C

Viewed 44

I have an issue when i try to run a code with 2D and 3D array. I tried with 2 different text editors (VSCode and Sublime Text) but none of them run the code. Can someone help me to solve this issue?

Here is my code :

#include <stdio.h>

#define CHARACTERS 5000
#define LINES2D 1000
#define COLUMNS2D 500
#define LINES3D 100
#define COLUMNS3D 50
#define THICKNESS3D 30

int main(){

    char tabchar[CHARACTERS];
    int tableau2D[LINES2D][COLUMNS2D];
    int tab3D[LINES3D][COLUMNS3D][THICKNESS3D];
    int i,j,k, nbcases;

    /*=== Tableau 1D ===*/
    nbcases = 0;
    for(i = 0; i<CHARACTERS; i++){
        tabchar[i] = ' ';
        nbcases++;
    }
    printf("Le tableau 1D a initialise %d cases \n", nbcases);

    /*=== Tableau 2D ===*/
    nbcases = 0;
    for (i = 0; i<LINES2D; i++){
        for(j = 0; j<COLUMNS2D; j++){
            tableau2D[i][j] = 0;
            nbcases++;
        }
    }
    printf("Le tableau 2D a initialise %d cases \n", nbcases);

    /*=== Tableau 3D ===*/
    nbcases = 0;
    for (i = 0; i<LINES3D; i++){
        for(j = 0; j<COLUMNS3D; j++){
            for(k = 0; k<THICKNESS3D; k++){
                tab3D[i][j][k] = 0;
                nbcases++;
            }
        }
    }
    printf("Le tableau 3D a initialise %d cases \n", nbcases);


    return 0;
}

and here is the output :

[Finished in 0.65s with exit code 3221225725]
0 Answers
Related