Dejo la Solucion por si alguien la necesita:
Código C++:
Ver originalclass Rent{
protected:
int rentNo;
timepoint from, to;
Vehicle *vehicle;
Driver *driver;
Rent *next;
static int lastRent;
public:
Rent(timepoint fr, timepoint t, Vehicle *v, Driver *d, Rent *n) : from(fr), to(t), vehicle(v), driver(d), next(n){
Rent::lastRent = 0;
rentNo = lastRent+1;
}
timepoint get_from(){
return from;
}
timepoint get_to(){
return to;
}
Rent get_next(){
return *next;
}
void set_from (timepoint c){
from = c;
}
void set_to (timepoint d){
to = d;
}
virtual void print(){
rentNo = 1+lastRent++;
cout << "VEHICLE RENT" << endl << "RentNo: " << rentNo << endl << "Vehicle: ";
vehicle->print();
cout << endl << "From: " << from << endl << "To: " << to << endl << "Driver: " << *driver << endl << endl;
}
};
int Rent::lastRent = 0;
El main es el mismo.
:)