Salut,
J'aimerai comprendre, si le message "segmentation fault" signifie bien ici que j'ai débordé quelque part dans la mémoire, parce que je ne vois pas où... :weird:
Je suis sur Cloud9, un environnement de dév Web.
https://chrome.google.com/webstore/d...mcpnamfnbkmkcp
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 #include <iostream> void fonction_ONE(int* tab, int size){ for(int index=1; index<=size; index++){ tab[index]=0; printf("%d",tab[index]); } printf("\n"); } void fonction_TWO(int tab[][5], int size){ for(int X=1; X<=size; X++){ for(int Y=1; Y<=size; Y++){ tab[X][Y]=0; printf("%d",tab[X][Y]); } printf("\n"); } } int main(){ int grid[5]; int matrice[5][5]; //fonction_ONE(grid,5); fonction_TWO(matrice, 5); }
Code:
1
2
3
4
5
6
7
8
9
10
11 Running /home/ubuntu/workspace/ultra.cc 00000 00000 00000 00000 00000 bash: line 12: 10123 Segmentation fault $file.o $args Process exited with code: 139
Bien à vous,
Ragoudcep.
EDIT :
Comme disait George.B, "quand on est c..., on est c... !!!" ^^' Navré du dérangement !Code:
1
2
3
4
5
6
7
8
9
10
11 void fonction_TWO(int tab[][5], int size){ for(int X=1; X<=size-1; X++){ for(int Y=1; Y<=size-1; Y++){ tab[X][Y]=0; printf("%d",tab[X][Y]); } printf("\n"); } }