// Fonction qui permettra de lire et modifier le tableau void rec_tab( bool *tableau, int& taille_1, int& taille_2 ) { for ( int i_t1 = 0; i_t1<taille_1; i_t1++ ) { for ( int i_t2 = 0; i_t2 < taille_2; i_t2++ ) tab[(int unsigned)((i_t1*taille_2)+i_t1))] = true; } }
int main () { int taille_dimension1, taille_dimension2; taille_dimension1 = 4; taille_dimension2 = 4; // Déclaration du tableau bool (Rappelez vous qu'un bool est codé sur 1 octet) bool tableau [taille_dimension1][taille_dimension2] = {false}; rec_tab ( tableau[0], taille_dimension1, taille_dimension2 ); return 0; }
bool tableau [ 2 ][ 2 ];
bool tableau [ 4 ]; // Parce que 2 * 2 = 4
tableau [ 1 ][ 0 ];
tableau [ 2 ];
tableau [ 1 ][ 1 ];
tableau [ 2 + 1 ];
Avis de décès, Carte de voeux, Bricolage, Coloriages, Cinéma, Coiffure, Cuisine, Déco, Dictionnaire, Horoscope, Jeux en ligne, Programme TV, Recettes, Restaurant, SMIC, Test débit, Voyage, Signification prénom