C++: Pushing certain number of objects into Stack out of X amount of objects?

Hello, I am confused on how I can push a certain number of objects into a Stack that has a limited size Let say I have a Stack that can only push in 2 objects but I have file that contains 5 vector objects . Stack<class , int> ..... Stack<Person, 5> Ex file has name, age, gender 0. Gabriel 20 M 1.... show more Hello, I am confused on how I can push a certain number of objects into a Stack that has a limited size

Let say I have a Stack that can only push in 2 objects but I have file that contains 5 vector objects .
Stack<class , int> ..... Stack<Person, 5>

Ex file has name, age, gender

0. Gabriel 20 M
1. Anne 35 F
2. Tim 5 M
3. Joe 40 M
4. Flo 31 F
5. Mike 10 M
6. Sam 18 F

How can I ask user to select 2 people and every time a user chooses a person, that person is popped off.

Ex.

cout << "Pick a person: " << endl;
cin >> choice;

output:
0.
display updated file:

1. Anne 35 F
2. Tim 5 M
3. Joe 40 M
4. Flo 31 F
5. Mike 10 M
6. Sam 18 F

And so on...

Any guidance is appreciated
2 answers 2