The function getline
is used differently. You should pass the string as a reference in which the result should be written. The return value of the function is a reference to the stream, which you can ignore.
In order to pass the firstName
you need to add the object of which you want to access the member, like you originally did with the left hand of the assignment.
getline(cin, Director.firstName);
So don't use the assignment operator (=
) here.