Bueno ya la parte de las variables esta solucionada, y ya no se queda colgado pero sigue sin imprimir al usar el for
Código Python:
Ver originalfor (i=0; i<n; i++){
ostringstream convert,convert1,convert2;
convert << "DU-CC " << i+1;
Scooter sc("Honda 110cc",convert.str());
vehicle[i] = static_cast<Vehicle*> (&sc);
//vehicle[i]->print(); CON ESTA LINEA IMPRIME PERO NO ES EL OBJETIVO
convert1 << "DU-Z " << i+1;
Cabrio ca("BMW Z5",convert1.str(),1,0);
vehicle[i+1] = static_cast<Vehicle *> (&ca);
//vehicle[i+1]->print();
convert2 << "DU-TA " << i+1;
Hartop ht ("Toyota Auris",convert2.str(),1,0,5);
vehicle[i+2] = static_cast<Vehicle *> (&ht);
//vehicle[i+2]->print();
}
Hartop fg1("Ford Galaxy","DU-FG 1",1,&nav1,7);
Hartop fg3("Ford Galaxy","DU-FG 2",1,&nav3,7);
Hartop *fg2 = &fg3;
vehicle[4] = static_cast<Vehicle *> (&fg1);
vehicle[4]->print();
vehicle[5] = static_cast<Vehicle *> (fg2);
vehicle[5]->print();
for (int i=0; i<(3*n+2); i++) //NO IMPRIME
vehicle[i]->print();
Da un error en la compilacion que dice: "pure virtual method called"
Agradeceria la ayuda :)