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
| using namespace std;
Plateau.cpp
Plateau:: Plateau(int h=9, int l=15): Etat(h,l)
{
hauteur = h;
largeur = l;
int i, j;
if ((h%2==0) && (l%2==0))
{
h = 9;
l = 15;
}
Etat **tab; Etat est un pointeur vers la classe Etat
/* Allocation dynamique */
tab = new Etat* [l];
for (i=0; i <l; i++)
tab[i] = new Etat[h];
/* Initialisation */
for (i=0; i < l; i++)
for (j=0; j < h; j++)
tab[i][j] = 1; L'erreur se trouve soit disant à ce niveau selon le compilateur.
} |
Partager