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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
//Classes:
class User_Data_Class{
private:
string Name;
string Pass;
string Access;
public:
User_Data_Class();
User_Data_Class(string n, string p, string a) : Name(n), Pass(p), Access(a){};
string Get_Name(){return Name;}
string Get_Pass(){return Pass;}
string Get_Access(){return Access;}
};
//Type Aliases:
using User_Data = vector <User_Data_Class>;
//Function Prototypes:
void Provide_User_Access(User_Data&);
void New_User_Entry(string, string, string, User_Data&);
int main(){
User_Data User;
//vector <User_Data> User;
//Assemble the user vector for user verification.
Provide_User_Access(User);
}
void Provide_User_Access(User_Data &User){
//Users to be added.
New_User_Entry("c", "c123", "creator", User);
}
//I'm getting an invalid arugments error with this:
void New_User_Entry(string n, string p, string a, User_Data &User){
//Add a user element to the User vector.
User_Data New_Entry {n, p, a};
User.push_back(New_Entry);
return;
}
//If I make these changes, I no longer get the errors. I don't understand why this is happening.
void New_User_Entry(string n, string p, string a, User_Data &User){
//Add a user element to the User vector.
User_Data_Class New_Entry {n, p, a};
User.push_back(New_Entry);
return;
}
|