This code is not running properly. : I tried to run the following code but after one input, the rest of the input is initialized to zero and is displayed on the screen automatically. where did I go wrong?

    
    #include<iostream>
    #define N 50
    using namespace std;

    struct movies_t
    {
        char title[60];
        int year;
    }user[N];

    void printmovie(movies_t);

    int main()
    {

        for(int i = 0; i < N; i++)
        {
            cout << "Enter title: ";
            cin.get(user[i].title, 60);
            cout << "Enter year: ";
            cin >> user[i].year;
       }
    
       cout << "\nYou have entered these movie: \n";
       for(int i = 0; i < N; i++)
            printmovie(user[i]);
       return 0;
    }

    void printmovie(movies_t m)
    {
         cout << m.title;
         cout << " (" << m.year << ")\n";
    }