Imagine something like account database of social network in C++. Each account has it's username, level (admin, etc.), list of users who follow this account and list of users who messaged this account.
Problem is, I wanna count number of messages received by each separate user, so name and count in inner struct gotta be linked together.
Is this good idea of implementation?
struct User {
string name;
int level;
vector<string> followedBy;
struct MessagedBy {
string name;
int count;
};
};
vector<User> users;
//@TODO vector of MessagedBy as an instance of User
How do I create vector of structs inside of vector of structs? How do I point at it?
int idto identify a user and to refer to them inMessagedByandfollowedBy?