1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Simple file input question?

Discussion in 'C' started by LeighRogers, May 8, 2007.

  1. LeighRogers

    LeighRogers New Member

    Joined:
    May 8, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    if (myfile.is_open())
      {
        while (! myfile.eof() )
        {
          for(int b=0;b<PlayListLength;b++)
          {
          getline (myfile,line);
          Title = line;
          getline (myfile,line);
          Artist = line;
          getline (myfile,line);
          Length = line;
          Playlist[b] = new Mp3(Title, Artist, Length);
          }
        }
    
    To read from a file and use three lines at a time to create a new mp3 within an array. I need the third value (Length) to be read as an int instead of a string.

    Can anyone help?!

    Thank you very much.

    Leigh Rogers
     

Share This Page