How do I call the menu function by passing more than one struct per reference according to validation in the validation function?
I'm sorry I'm starting now and I decided to do this little exercise to practice functions, classes, and structs and I came across this problem that I can not solve. Can someone please help me?
class Conta {
private:
struct cliente_1 {
string nome = "Odair";
int conta = 739146;
double senha = 759247;
float saldo = 00.00;
double cpf = 48730701875;
};
struct cliente_2 {
string nome = "Leo";
int conta = 135478;
double senha = 789878;
float saldo = 00.00;
double cpf = 48730701875;
};
struct cliente_3 {
string nome = "Caio";
int conta = 789757;
double senha = 24860165;
float saldo = 00.00;
double cpf = 48730701875;
};
struct clientes {
cliente_1 c1;
cliente_2 c2;
cliente_3 c3;
};
public:
void menu( cliente_1 cont) {
cout << cont.nome << endl;
system("pause");
}
void validacao(int x, double y) {
cliente_1 c1;
cliente_1 c2;
cliente_1 c3;
if (x == 739396 || y == 759247) {
menu(c1);
}
else if (x == 135478 || y == 789878) {
menu(c2);
}
else if (x == 789757 || y == 24860165) {
menu(c3);
}
}