1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#include <iostream>
#include <string>
using namespace std;
struct MovieInfo
{
string title, director;
int year, time;
MovieInfo(string t, string d, int y, int t2)
{
string title1, director1;
int year1, time1;
}
MovieInfo(string t, string d, int y, int t2)//Here I am supposed to use this MovieInfo three times but how can I do it.
{
string title2, director2;
int year2, time2;
}
};
void DisplayMovieInfo(MovieInfo &md);
int main()
{
MovieInfo movie1("War of the Worlds", "Byron Haskin", 1953, 88),
movie2("War of the Worlds", "Stephen Spielberg", 2005, 118),
movie3("War of the Worlds", "Stephen Spielberg", 2005, 118);
DisplayMovieInfo(movie1);
DisplayMovieInfo(movie2);
DisplayMovieInfo(movie3);
return 0;
}
void DisplayMovieInfo(MovieInfo &md)
{
cout << "The movie " << md.title << " was directed by " << md.director << " and released in " << md.year << " with a run time of " << md.time << " minutes " << endl;
}
|