#include <iostream>
#include <vector>
struct Friend{
Friend(const int &must_authority,const int &add_authority): must_authority(must_authority), add_authority(add_authority){}
int must_authority, add_authority;
};
int main(){
int nFriends, authority;
std::cin >> nFriends >> authority;
std::vector<Friend> v_friend;
for (int i = 0; i < nFriends; i++){
v_friend.push_back(???);
}
return 0;
}
1) Как считать из потока в конструктор? Аля:
Friend new_friend(след_число, след_число);
2) Можно ли создавать объект во время добавления?
v_friend.push_back(Friend(1, 1) );
или в таком случаи лучше писать так:
std::vector<Friend*> v_friend;
v_friend.push_back(new Friend(1,1) );