mickey
6th July 2006, 16:47
hi, I need to obtain a vector of arrays;
Is this correct? thanks
GLfloat* position = new GLfloat[4];
vector <GLfloat*> ppp;
for (int g=0; g < ....; g++) {
for (int i=0; i<4; i++) {
position[i] = ch.toInt(); // split a string as "1543"
}
ppp.push_back(position);
}
for( std::vector<GLfloat*>::iterator i = ppp.begin(); i != ppp.end(); ++i ) {
delete [] *i;
}
ppp.clear();
Is this correct? thanks
GLfloat* position = new GLfloat[4];
vector <GLfloat*> ppp;
for (int g=0; g < ....; g++) {
for (int i=0; i<4; i++) {
position[i] = ch.toInt(); // split a string as "1543"
}
ppp.push_back(position);
}
for( std::vector<GLfloat*>::iterator i = ppp.begin(); i != ppp.end(); ++i ) {
delete [] *i;
}
ppp.clear();