Hallo,
ich sitzt vor nem Fehler und komm einfach nicht weiter. Mittlerweile denke ich schon fast, dass es am Compiler liegt
Hier sind 3 Versuche mit Errors:
Versuch 1:
Code:
Code:
class CConsignmentMng
{
private:
map<DWORD,char> m_mapItems;
CConsignmentMng();
~CConsignmentMng();
public:
static CConsignmentMng *Instance();
public bool IsBuyable(DWORD dwSEQ);
public void BuyItem(DWORD dwSEQ);
public void RemoveItem(DWORD dwSEQ);
public void AddItem(DWORD dwSEQ, char cState = 'O');
}
Error:
Quote:
error C2144: syntax error : 'bool' should be preceded by ':'
error C2144: syntax error : 'void' should be preceded by ':'
error C2144: syntax error : 'void' should be preceded by ':'
error C2144: syntax error : 'void' should be preceded by ':'
|
Versuch 2:
Code:
Code:
class CConsignmentMng
{
private:
map<DWORD,char> m_mapItems;
CConsignmentMng();
~CConsignmentMng();
public:
static CConsignmentMng *Instance();
bool IsBuyable(DWORD dwSEQ);
void BuyItem(DWORD dwSEQ);
void RemoveItem(DWORD dwSEQ);
void AddItem(DWORD dwSEQ, char cState = 'O');
}
Error:
Quote:
|
error C2533: 'CConsignmentMng::__ctor' : constructors not allowed a return type
|
==>
Code:
CConsignmentMng::CConsignmentMng()
{
m_mapItems.clear();
}
Versuch 3:
Code:
Code:
class CConsignmentMng
{
private:
map<DWORD,char> m_mapItems;
CConsignmentMng();
~CConsignmentMng();
public:
static CConsignmentMng *Instance();
bool IsBuyable(DWORD dwSEQ);
void BuyItem(DWORD dwSEQ);
void RemoveItem(DWORD dwSEQ);
void AddItem(DWORD dwSEQ, char cState = 'O');
};
Error:
Quote:
error C2653: 'CConsignmentMng' : is not a class or namespace name
error C2227: left of '->AddItem' must point to class/struct/union
type is ''unknown-type''
//...
|
Was mach ich falsch?
mfg lolxdfly