How do you create data structure?

After gathering more information for movie netflix project,
I needed to use the data structure.
So, I have re-done my code as below:
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <iostream> // library that contains basic input output functions
#include <string>
#include <sstream>
using namespace std;

struct movie_t
{
string Title;
int Year;
int Rating;
} mine;

int main()
{
  int choice;
  do
  { 
     cout << "1. Display Movie Queue " << endl;
     cout << "2. Add Movie to Queue " << endl;
     cout << "3. Edit Movie in Queue" << endl;
     cout << "4. Remove Movie from Queue " << endl;
 cout << "5. Search for Movie in Queue " << endl;
cout << "6. Exit Program " << endl;

cout << "Enter option : ";
     cin >> choice;
     
     if(choice == 1) 
     {
 	cout << "The movie queue is empty! Please add movies to the queue. " << endl;
}
     
     else if(choice == 2)
     {
	mine.Title = "The Wizard of Oz";
	mine.Year = 1939;
	mine.Rating = R;

	cout << "Enter title: ";
	getline (cin,mine.Title);
	cout << "Enter Year: ";
	getline (cin,mine.Year);
	cout << "Rating: ";
	getline (cin.mine.Rating);
     }
     else if(choice == 3)
     {
	// Empty
}
     else if(choice == 6)
     {
       cout << "Exit Program. Good Bye !" << endl;
     }
     else
     {
cout << "Invalid Option entered" << endl;
     }
  }
  while(choice ==6);
   return 0;
}

Please correct me.
My question is that, when I choose option 2 again, i want the program to call
another different data . How do I do this?
thank you
You need a collection of movie titles, not just a single one. For example, you could make a vector of movies.
After line 3 add #include <vector>
After line 11 add vector<movie_t> movies;
After line 44 add movies.push_back(mine);

Oh, line 59 is wrong. It should be while (choice != 6);
Topic archived. No new replies allowed.