Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. DVD Class

DVD Class

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionc++data-structureslearning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    foxele
    wrote on last edited by
    #1

    I am a beginner of C++ programming. Please help me I came across this problem of creating a DVD class. The part I don't understand is in my handout for project, the instuctor asked us to assume DVD consists of a number of audio/video chapters, How can I store data(like lyric of a song) into those Chapters? Should I create a class named Chapters and use an array of Chapters in DVD class? I mean we only pass data through like: DVD* dvd = new DVD("show me the meaning of being lonly"; but all I can do is store one line into the class, how can I store the whole lyric into the class? hu yu

    D 1 Reply Last reply
    0
    • F foxele

      I am a beginner of C++ programming. Please help me I came across this problem of creating a DVD class. The part I don't understand is in my handout for project, the instuctor asked us to assume DVD consists of a number of audio/video chapters, How can I store data(like lyric of a song) into those Chapters? Should I create a class named Chapters and use an array of Chapters in DVD class? I mean we only pass data through like: DVD* dvd = new DVD("show me the meaning of being lonly"; but all I can do is store one line into the class, how can I store the whole lyric into the class? hu yu

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      foxele wrote: Should I create a class named Chapters and use an array of Chapters in DVD class? This sounds reasonable. foxele wrote: DVD* dvd = new DVD("show me the meaning of being lonly"; but all I can do is store one line into the class, how can I store the whole lyric into the class? How about:

      DVD dvd;
      CHAPTER *chapter;
      chapter = dvd.AddChapter();
      chapter.AddLyrics("This is line 1");
      chapter.AddLyrics("This is line 2");
      // or
      chapter.AddLyrics("This is line 1\nThis is line 2");


      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups