1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Issues with Arrays

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

  1. golf_girl32

    golf_girl32 New Member

    Joined:
    Sep 28, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    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.

    Code:
    #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;
        reOrderDate.day = 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.day <<reOrderDate.year <<endl;
     Video allVideos[5];
     void getVideo (Video shows[],int number_of_shows);
        {
            
        }
    
     
  2. ihatec

    ihatec New Member

    Joined:
    Sep 1, 2010
    Messages:
    20
    Likes Received:
    3
    Trophy Points:
    0
    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