Vecteurs 3D

nonocpp Messages postés 18 Date d'inscription jeudi 11 août 2005 Statut Membre Dernière intervention 17 mai 2006 - 28 oct. 2005 à 09:52
DoctorNitro Messages postés 3 Date d'inscription samedi 28 mars 2009 Statut Membre Dernière intervention 16 juillet 2009 - 16 juil. 2009 à 19:59
#include
#include <vector>
#include <fstream>

using namespace std;
int main(void)
{
int i,k,j;
ofstream arno;
vector<vector<vector*>*> Vect;
int ClientsMax=4;
for (k=0;k<m_nbClientsMax;k++)
{
Vect.push_back(NULL);
Vect[k]=new vector <vector*>(ClientsMax,new vector(3,false));
}

(*(*Vect[2])[2])[2]=true;

arno.open("debug.txt");

for (i=0;i<ClientsMax;i++)
{
for (j=0;j<ClientsMax;j++)
{
for (k=0;k<3;k++)
{
arno<<(*(*Vect[i])[j])[k]<< " ";
}
arno<<endl;
}
arno<<endl;
}
arno.close();


return 0;
}

en lancant cela, j obtiens cela :
0 0 0
0 0 0
0 0 0
0 0 0


0 0 0
0 0 0
0 0 0
0 0 0


0 0 1
0 0 1
0 0 1
0 0 1


0 0 0
0 0 0
0 0 0
0 0 0

alors qu il ne devrait y avoir qu un seul 1 !!!!!!!!!!!!!! à la position (2,2,2)
une idée de mon erreur ?
Merci

nono

1 réponse

DoctorNitro Messages postés 3 Date d'inscription samedi 28 mars 2009 Statut Membre Dernière intervention 16 juillet 2009
16 juil. 2009 à 19:59
hé ben nono
0
Rejoignez-nous