Feb 5, 2012 at 6:12pm UTC
the while loop is the reference.
here are the errors:
Warning 1 warning C4018: '<' : signed/unsigned mismatch c:\users\mike\documents\hw\project3.1\project3.1\project3.1.cpp 212
Error 2 error C2660: 'Bookings::display_name' : function does not take 0 arguments c:\users\mike\documents\hw\project3.1\project3.1\project3.1.cpp 215
3 IntelliSense: too few arguments in function call c:\users\mike\documents\hw\project3.1\project3.1\project3.1.cpp 215
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
class Bookings{
public :
Bookings();
string name;
void display_name(string name);
};
class BookingDetails{
public :
BookingDetails();
int date;
int start_date;;
int length_of_stay;
double price;
};
class Users{
public :
Users();
vector<Bookings> BookingsVector;
string username;
};
class Reservation{
public :
Reservation();
vector<Users> UsersVector;
};
Bookings::Bookings(){
};
Users::Users(){
};
int main(){
int loop=0;
Users userMain;
Bookings bookMain;
Reservation reservationMain;
BookingDetails detailsMain;
Rates rateMain;
cin>>bookMain.name;
while (loop <userMain.BookingsVector.size()){
cout<<"[" <<loop<<"]" ;
userMain.BookingsVector[loop].display_name();
loop=loop+1;}
}
Last edited on Feb 5, 2012 at 6:15pm UTC
Feb 5, 2012 at 6:22pm UTC
display_name does not take 0 arguments. Clearly you declared it to take 1 string argument. But on line 54 you pass nothing. Either change declaration/definition or pass something..
Feb 5, 2012 at 6:25pm UTC
i'm confused on how i would "pass something" so it displays all the name's enter by the user
Feb 5, 2012 at 7:06pm UTC
got it, switched the declaration thank you!