#ifndef MOVIE_
#define MOVIE_
#include <iostream>
#include <string>
#include <vector>
usingnamespace std;
enum Movie_Rating {G,PG,PG13,R,NC17,NR} ;
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
class Movie
{
public:
// ------------------------------------------------------
// ----- Constructors -----------------------------------
// ------------------------------------------------------
//Default constructor
Movie();
//Copy Constructors
Movie(const string& title) ;
Movie(const string& title,
const string& director,
Movie_Rating rating,
unsignedint year,
const string& path, const vector<string> &actors) ;
// ------------------------------------------------------
// ----- Destructor -------------------------------------
// ------------------------------------------------------
~Movie(); // To be implemented in a future assignment.
// ------------------------------------------------------
// ----- Inspectors -------------------------------------
// ------------------------------------------------------
//gets the movie title
string getTitle() const ;
//gets the movie director
string getDirector() const ;
//gets the movie rating
Movie_Rating getRating() const ;
//gets the release date of the movie
unsignedint getYear() const ;
//gets the imdb url of the movie
string getURL() const ;
//gets the actors of the movie
vector<string> getActor() ;
// ------------------------------------------------------
// ----- Mutators ---------------------------------------
// ------------------------------------------------------
//sets the title of the movie
void Movie::setTitle(const string& title);
//sets the director of the movie
void setDirector(const string& director) ;
//sets the rating of the movie
void setRating(Movie_Rating rating) ;
//sets the year the movie was released
void setYear(unsignedint year) ;
//sets the imdb url of the movie
void setURL(const string& path) ;
//sets the actor(s) of the movie
void setActor(vector<string> & actors) ;
//converts the enum Movie_Rating to string type
string convert_rating(Movie_Rating r);
//----------------------------------------------------------
//----- Facilitators ---------------------------------------
//----------------------------------------------------------
//prints the output
string toString ();
//---------------------------------------------------------------------
// The ostringstream type allows output to be directed to
// a string in the same style as usually done with a stream.
//---------------------------------------------------------------------
void output(ostream & out);
// ----------------------------------------------------------
// ----------------------------------------------------------
private:
string title_ ;
string director_ ;
Movie_Rating rating_ ;
unsignedint year_ ;
string url_ ;
vector <string> actors_;
};
#endif
What are you trying to do with this? actors_= actors_.push_back(actors);
If you're trying to use push_back, it should just be actors_.push_back(actors);
you don't need to assign anything with the assignment operator.
with actors_ = actors_.push_back(actors)
I'm trying to set it to actors_ so that when i use it on the toString() function it will print the actors that the user has input into the program