Skip to content
Snippets Groups Projects
Verified Commit d525d2cf authored by orestis.malaspin's avatar orestis.malaspin
Browse files

added beginning table

parent 11173673
Branches
No related tags found
No related merge requests found
...@@ -366,9 +366,31 @@ void main() { ...@@ -366,9 +366,31 @@ void main() {
while (tmp_n%tmp_m > 0) { while (tmp_n%tmp_m > 0) {
int tmp = tmp_n; int tmp = tmp_n;
tmp_n = tmp_m; tmp_n = tmp_m;
tmp_m = tmp%tmp_m; tmp_m = tmp % tmp_m;
} }
printf("Le pgcd de %d et %d est %d\n", n, m, tmp_m); printf("Le pgcd de %d et %d est %d\n", n, m, tmp_m);
} }
``` ```
# Collections: tableaux statiques
* Collection d'objets de même type dont le nombre est connu à la
compilation;
* Stockés contigüement en mémoire, sur la pile;
```C
int entiers[] = {2, 1, 4, 5, 7}; // taille 5, initialisé
int tab[3]; // taille 3, non initialisé
```
* Les indices sont numérotés de `0` à `taille-1`.
```C
int premier = entier[0];
int dernier = entier[4];
```
* Les tableaux sont **non-initialisés** par défaut.
```C
int indetermine = tab[1];
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment