DVD Class
-
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
-
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
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)