Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 639229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:49:10+00:00 2026-05-13T20:49:10+00:00

I have a media program. i am adding CD,dvd,book info. I managed to get

  • 0

I have a media program. i am adding CD,dvd,book info. I managed to get the book info added to the set. I am now adding the CD info. I have most of the Cd info added but i have a seperate function for adding band members. thats where i need help!

I am getting a cast error: error C2440: ‘type cast’ : cannot convert from ‘const Item *const ‘ to ‘CD’

CD.h

#ifndef CD_H
#define CD_H
#pragma once
#include "item.h"

class CD : public Item
{
public:

    CD(const string& theTitle, const string& theBand, const int snumber);
    const string addBandMember(const string& member);
    const int getNumber() const;
    const string getMusician() const;

    const string getBand() const;
    virtual void print(ostream& out) const;
    ~CD();


private:

    string band;
    string musicians;
    string title;
    int number;

};

ostream& operator<<(ostream& out, const CD* cd);

#endif

CD.cpp

const string CD::addBandMember(const string &member)
{

    return this->musicians = member;

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:49:10+00:00Added an answer on May 13, 2026 at 8:49 pm

    In Library::addBandMember you’re trying to cast a pointer to a class type
    you need to cast to CD* not CD

    And you probably don’t want the 2 const in

    const Item* const musicCD  
    

    since you want to modify the musicCD !

    finally your CD::addBandMember method doesn’t seem to add a band member but replace it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have the following select statement, but I wish to move to full
The question I have is that of securing documents across services using RavenDb and
I have been using a mp3 file in my application for over 3 weeks
I have a .wav file in my www folder. I am using jQuery with
How do I get my <button> s to look consistent in Firefox and Chrome?
Please have a look on code written below. I am trying to have a
I've been having quite a difficult time extracting ID3 information from an MP3 being
I bought a very weak netbook that comes preinstalled with android 2.0 which I
In android I can't figure out why this cursor is empty in htc wildfire.
I am working on a Facebook IFrame app and using FB.ui to display the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.