How do i make this void function work with array?

this is what the function is supposed to do:

RegisterCourse(int id[ ], string name[ ], string course[ ], int size)

Page 3 of 3 This function is called when user selects option number 3. It asks the user to enter the course he wants to register (computer programming or data structure). Then the program first check whether the student have taken course prerequisite. If yes, then the registered course become what the user has entered, otherwise, the system informs the user that the course he is trying to register is not allowed. I tried doing it like that

void RegisterCourse(int id[], string name[], string course[], int size)
{
    int i;
    string line;
    file.open("Text.txt");
    cout << "Enter the last number of your student number:";
    cin >> i;
    cout << "Enter your student number:";
    cin >> id[i];
    cout << "Enter your student name:";
    cin >> name[i];
    cout << "Enter the course you want to register:";
    cin >> course[i];
    file << id[i] << "   " << name[i] << "   " << course[i];
    

}

but it's not working, the course didn't change as it is supposed to