For my latest CS homework, I am required to create a class called Movie which holds title, director, year, rating, actors etc.
Then, I am required to read a file which c
As far as I understand, you create a Movie class:
class Movie
{
private:
std::string _title;
std::string _director;
int _year;
int _rating;
std::vector actors;
};
and having such class, you create a vector instance:
std::vector movies;
so, you can add any movie to your movies collection. Since you are creating a vector of pointers to movies, do not forget to free the resources allocated by your movie instances OR you could use some smart pointer to deallocate the movies automatically:
std::vector> movies;