103 IntelliSense: no instance of overloaded function "std::vector<_Ty, _Ax>::push_back [with _Ty=Users, _Ax=std::allocator<Users>]" matches the argument list c:\users\mike\documents\hw\project 3\problem 3.cpp 97
#include<iostream>
#include<vector>
#include<string>
#include<math.h>
usingnamespace std;
class Rates{
public:
Rates();
int monthRate;
int weekRate;
int dayRate;
};
Rates::Rates(){
};
class Bookings{
public:
Bookings();
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(){
};
Reservation::Reservation(){
};
int main(){
Users userMain;
Bookings bookMain;
Reservation reservationMain;
BookingDetails detailsMain;
int opselect; //global variavbles for entering options
int userselect;
int accesslevel;
int rateSelect;
int paySelect;
int mainRateSelect;
int returnMenu=0;
int checkSelect;
string logout=logout;
cout<<"Please go into Manager Access Level to set-up rates/n";
cout<<"Welcome to the Shady Inn Motel Reservation System!"<<endl //welcome screen, asks if user
<<"Are you a new user?"<<endl
<<"1. Yes"<<endl
<<"2. No"<<endl;
cin>>userselect;
switch(userselect){
case 1:{
cout<<"Welcome new user!:"<<endl;
cout<<"Please enter user name:"<<endl; //enter username
cin>>bookMain.name; //write username to user vector
reservationMain.UsersVector.push_back(userMain.username);
cout<<endl;
in line 97 userMain.username is of type std::string and your vector was expecting type User.
instead of reservationMain.UsersVector.push_back(userMain.username);
try reservationMain.UsersVector.push_back(userMain);
or in your user class define a constructor like