solved

closed account (S23vqMoL)
solved.
Last edited on
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.

closed account (S23vqMoL)
ok thanks, so i finally got the errors in my facilitator fixed by using the scope resolution

1
2
3
4
5
6
7
                void Movie::output(ostream & out) {
			out << "Movie: " << title_ << endl 
			      << "Director: " << director_ << endl  
			      << "Year: " << year_ << endl
			      << "Rating: " << rating_ << endl
			      << "IMDB URL: " << url_ << endl;
		}

Last edited on
closed account (S23vqMoL)
Now all i need to figure out is the copy constructor methods. Any suggestions?
1
2
3
4
5
6
7
8
9
10
11
12
		//Copy Constructors
			Movie::Movie(const string& title) {
				//method implementation
			}

			Movie::Movie(const string& title, 
			      const string& director, 
			      Movie_Rating rating,
			      unsigned int year,
				  const string& path) {
				//method implementation
			}
Last edited on
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.

closed account (S23vqMoL)
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,
			      unsigned int year,
				  const string& path) {
				//method implementation
			}


Also note you probably should create the no argument constructor as well.

closed account (S23vqMoL)
solved. thanks for the help!
Last edited on
Don't delete your questions after you get a response. It's a jerk move.
Topic archived. No new replies allowed.