#include <iostream>
#include <string>
using namespace std;
enum Banks { PKO, BGZ, BRE, BPH };
struct Account {
Banks bank;
int balance;
};
struct Person {
string name;
Account account;
};
struct Couple {
Person he;
Person she;
};
//const Couple* bestClient(const Couple* cpls,
// int size, Banks bank) {
// ...
//}
int main() {
using std::cout; using std::endl;
Couple cpls[] = {
{ { "John",{ PKO,1200 } },{ "Marry",{ BGZ,1500 } } },
{ { "Peter",{ BGZ,1300 } },{ "Suzy",{ BRE,1300 } } },
{ { "Kevin",{ PKO,1600 } },{ "Katy",{ BPH,1500 } } },
{ { "Kenny",{ BPH,1800 } },{ "Lucy",{ BRE,1700 } } },
};
//const Couple* p = bestClient(cpls, 4, BGZ);
//cout << p->he.name << " and " << p->she.name
// << ": " << p->he.account.balance +
// p->she.account.balance << endl;
system("pause");
}
I jak teraz mam przy użyciu tych struktur dostać się do poszczególnych danych z tablicy w funkcji
//const Couple* bestClient(const Couple* cpls,
// int size, Banks bank) {
// ...
//}
nigdzie znaleźć nie mogę jak obsługiwać taką tablice, znalazłem tylko pod pojedyncze obiekty .