Initialisation int ** avec new et destruction
batmat
Messages postés
1871
Statut
Membre
-
weblook Messages postés 78 Statut Membre -
weblook Messages postés 78 Statut Membre -
Voila je cherche a declarer dans un classe matrice un int**mat;
et un int taille;
seulement je ne suis pas sur du tout de mon appel à new et delete :
HELP!!!!!!!!!!!!!!!!!
Matrice ::Matrice(int n)
{
taille=n;
mat=new int*[n];
for(int i=0;i<n;i++)
mat[i]=new int[n];
}
Matrice::~Matrice(void)
{
for(int i=0;i<taille;i++)
delete []mat[i];
delete []mat;
}
Merci d'avance
et un int taille;
seulement je ne suis pas sur du tout de mon appel à new et delete :
HELP!!!!!!!!!!!!!!!!!
Matrice ::Matrice(int n)
{
taille=n;
mat=new int*[n];
for(int i=0;i<n;i++)
mat[i]=new int[n];
}
Matrice::~Matrice(void)
{
for(int i=0;i<taille;i++)
delete []mat[i];
delete []mat;
}
Merci d'avance
A voir également:
- Initialisation int ** avec new et destruction
- Indicatif new york - Forum Mobile
- New cpu installed ftpm/psp nv corrupted or ftpm/psp nv structure changed - Forum BIOS
- Destruction disquettes informatiques - Forum Virus
- New york 911 télécharger - Forum Cinéma / Télé
- Comment avoir un amoureux dans animal crossing new horizon - Forum Jeux vidéo