Got this small code which results in "windows has encountered a problem with this and has to close it down etc etc " error
It happens at user input
Code:#include<iostream> #include<list> #include<string> using namespace std ; struct Movie { string MovieName; string MovieDirector; string MovieActor; string MovieActress; string MovieGenre; int MovieRating; }; int main() { string MName; string name; list<Movie> Movie_List; list<Movie>::iterator ListIterator; cin>>name; ListIterator = Movie_List.begin(); ListIterator->MovieName = name ; ListIterator = Movie_List.begin(); cout<<ListIterator->MovieName; return 0 ; }