All of your data is private, so in your operator>> you'll need to use the getters() you've defined instead of the variables. The other option would be to make the operator overload a friend.
Are you just trying to create the copy constructor for practice? This class doesn't really need a copy constructor, the default compiler supplied version will work. But you can use your favorite search engine to find information on "C++ copy constructors". Don't forget if you make a copy constructor you should also make the assignment operator and the destructor.
It's mostly for an excercise i have to do in school. They didn't even teach us how to implement all of these methods, so im having a really hard time in making the program. I'm trying to make it so that it will ask a user to input a movie info like title, author, etc. then it'll return the Movie object to the return program then display the movie attributes.
Also I don't see any copy constructor. I see a constructor that takes a string argument, and a constructor that takes several arguments, but no copy constructor. Maybe you should start by implementing the constructors.
1 2 3 4 5 6 7 8 9 10 11 12
//Copy Constructors // No this is the one argument constructor.
Movie::Movie(const string& title) {
//method implementation
}
// Multiple argument constructor.
Movie::Movie(const string& title,
const string& director,
Movie_Rating rating,
unsignedint year,
const string& path) {
//method implementation
}
Also note you probably should create the no argument constructor as well.