English 中文(简体)
C++, recieve this whentries to各年级:差错:无“避免媒体:*(......)在“媒体”类中宣布其成员职能
原标题:C++, recieve this when trying to create classes: error: no ‘void media::*()’ member function declared in class ‘media’

一些新到的P++,试图创建类别/功能,使我今后的代码变得干净。 我正在使用《法典》:24小时制作我的节目,此时收到以下电码和头号电文,用于打碎型、泥土和挖土机。 编审员是“快乐”,这不是主要方案。

负责人档案:

#ifndef MUSIC_H
#define MUSIC_H
using namespace std;

class media
{
public:
    media();
    virtual ~media();

protected:
    string detectdisc;
private:

};

class disctype: public media
{
public:
    disctype();
};

class ripmusic: public media
{
public:
    ripmusic();
};

class dvdmanip: public media
{
public:
    dvdmanip();
};

#endif // MUSIC_H

The cpp file:

#include "media.h"

//using namespace std;
media::media()
{
//ctor
}

media::~media()
{
//dtor
}

void media::disctype()
{
    do
        detectdisc= system(cdde -b)
    while detectdisc != ""

    if (detectdisc == "An audio cd was inserted.")
    {
        ripmusic();
    }
    else if (detectdisc == "A dvd was inserted.")
    {
        dvdmanip();
    }
}

void media::ripmusic()
{
    musicrip.hidden=false
}

void media::dvdmanip()
{
    //musicrip.hidden=false
}
问题回答

错误信息告诉你,在媒体中,你没有特定成员方法(部门:<代码>media并不包含成员<代码>ripmusic()、dvdmanip()和disctype()”,你试图以后加以界定。 你们的成员定义必须改变为:

void disctype::disctype(){...}
void ripmusic::ripmusic(){...}
void dvdmanip::dvdmanip(){...}

你们正在使用类似方法的继承类别。

disctype();
ripmusic()
dvdmanip()

宣布为一类,这样你就能够写字。

 void media::dvdmanip() {} etc...

界定你作为媒体界成员的职能。

3. 改变主人档案:

#ifndef MUSIC_H
#define MUSIC_H
using namespace std;

class media
{
public:
    media();
    virtual ~media();
    void disctype();
    void ripmusic();
    void dvdmanip();

protected:
    string detectdisc;
private:

};




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签