Issues with Arrays

Discussion in 'C++' started by golf_girl32, Nov 4, 2010.

  1. golf_girl32

    golf_girl32 New Member

    Sep 28, 2010
    Likes Received:
    Trophy Points:
    I am mostly finished with my program. All I need to do is at the end enter 5 movie titles and have them print out "Movie Title 1: " etc for all 5. I'm stuck on how to do that at the end.

    #include <iostream>
     using namespace std;
     //Structure for each video information
    struct Video
      string movieTitle;
        int numberCopies;
        string videoType;
     struct re_order_Date
     int month;
        int day;
        int year;
     void get_Video(Video shows[], int number_of_shows);
     int main()
     Video videoInfo;
        videoInfo.movieTitle = "Fight Club";
        videoInfo.numberCopies = 15;
        videoInfo.videoType = "Mystery";
     cout<<"The Title of the movie is: "<<videoInfo.movieTitle<<endl;
        cout<<"The number of copies are: "<<videoInfo.numberCopies<<endl;
        cout<<"The type of video is: "<<videoInfo.videoType<<endl;
     Video videoinfo2;
        re_order_Date reOrderDate;
        videoinfo2.movieTitle = "Requiem for a dream";
        videoinfo2.numberCopies = 10;
        videoinfo2.videoType = "Drama";
        reOrderDate.month = 05; = 17;
        reOrderDate.year = 2011;
     cout<<"The Title of [U]the movie[/U] is: "<<videoinfo2.movieTitle<<endl;
        cout<<"The number of copies are: "<<videoinfo2.numberCopies<<endl;
        cout<<"The type of video is: "<<videoinfo2.videoType<<endl;
    cout<<"The re-order date of the movie is: "<<reOrderDate.month << <<reOrderDate.year <<endl;
     Video allVideos[5];
     void getVideo (Video shows[],int number_of_shows);
  2. ihatec

    ihatec New Member

    Sep 1, 2010
    Likes Received:
    Trophy Points:
    Did you try to use loops?
    For arrays the best idea is to use for loop(because you know the size of it) for entering and printing your data.

    shabbir likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice