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

maj base_2

parent a9b57bb3
No related branches found
No related tags found
No related merge requests found
......@@ -182,8 +182,8 @@ ERROR # si tout s'est mal passé
## Généralités
- C offre uniquement des tableaux statiques
- Un tableau est un "bloc" de mémoire contigüe associé à un nom
- `C` offre uniquement des tableaux statiques
- Un tableau est un "bloc" de mémoire contig associé à un nom
- taille fixe déterminée à la déclaration du tableau
- la taille ne peut pas être changée.
- Pas d’assignation de tableaux.
......@@ -201,7 +201,7 @@ ERROR # si tout s'est mal passé
float tab1[5]; // tableau de floats à 5 éléments
// ses valeurs sont indéfinies
int tab2[] = {1, 2, 3}; // tableau de 3 entiers
int tab2[] = {1, 2, 3}; // tableau de 3 entiers, taille inférée
int val = tab2[1]; // val vaut 2 à présent
......@@ -288,7 +288,7 @@ do {
}
}
// avec taille, [n] pas obligatoire
void bar(int tab[n], int n) {
void bar(int n, int tab[n]) { // n doit venir avant tab ici
for (int i = 0; i < n; ++i) {
printf("tab[%d] = %d\n", i, tab[i]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment