having trouble with vector begin

I read the vector:begin reference but i'm still having trouble implementing it into my code. i dont know how to exactly use pointers, should i do cout<<"["<<loop<<"]"*it? when it removes a booking, then it doesnt display the previous bookings. would the begin help?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class Bookings{
public:
	Bookings();
	string name;
	void display_name();
};
class Users{
public:
	Users();
	vector<Bookings> BookingsVector;
	string username;
};
Bookings::Bookings(){
};

Users::Users(){
};
int main(){

Bookings::display_name{
cout<<name<<endl;
};


case 2:{

					std::cout<<"Welcome to the edit booking menu!"<<endl
					<<"select booking"<<endl;
					
	
	while(loop <userMain.BookingsVector.size()){
		vector<Bookings>::iterator it;
	it=userMain.BookingsVector.begin();
		cout<<"["<<loop<<"]";
		userMain.BookingsVector[loop].display_name();
	
	
	loop=loop+1;}
	cin>>book_name_select;

	userMain.BookingsVector.erase(userMain.BookingsVector.begin()+book_name_select);
Last edited on
Topic archived. No new replies allowed.