There's many ways to do it, but it depends on the situation...
How many accounts can a customer have? How many customers can an account belong to? Do you need to access accounts through the user (i.e. given a user, find his account(s)), or the other way (i.e. given an account, find the user(s) it belongs to), or both?
If each user has one account, you could ensure 'forward access' by giving the Customer class an Account member, or an Account pointer member that points to an account in accounts[], or simply an integer 'accountID' that stores in the index of that Customer's account in accounts[]. If you need 'backward access', you can use those two last options in the reverse way as well.
Alternatively, if a user and account are *always* attached to each other, you could simply pair them up:
1 2 3 4
|
struct CAPair {
Account acc;
Customer cust;
}
|
Then, keep vector of CAPairs.
It all depends on how you organize your data, which depends on the functionality you need. If you have the time, it might be fun/interesting to try several methods to see the (dis)advantages of each.