Initialisation int ** avec new et destruction
batmat
Messages postés
1880
Date d'inscription
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
- We detected a new ftpm firmware ✓ - Forum BIOS
- New tab google ✓ - Forum Virus
- Initialisation - Forum Matériel & Système
- Int converter - Télécharger - Bureautique
- Échec de l’initialisation de l’inscription du certificat scep - Forum PC portable