Je suis nouveau à C++, en essayant de déboguer la ligne de code suivanteerreur de syntaxe: missing ';' avant identifiant
class cGameError
{
string m_errorText;
public:
cGameError(char *errorText)
{
DP1("***\n*** [ERROR] cGameError thrown! text: [%s]\n***\n",
errorText);
m_errorText = string(errorText);
}
const char *GetText()
{
return m_errorText.c_str();
}
};
enum eResult
{
resAllGood = 0, // function passed with flying colors
resFalse = 1, // function worked and returns 'false'
resFailed = –1, // function failed miserably
resNotImpl = –2, // function has not been implemented
resForceDWord = 0x7FFFFFFF
};
Ce fichier d'en-tête est inclus dans le programme comme suit
#include "string.h"
#include "stdafx.h"
#include "Chapter 01 MyVersion.h"
#include "cGameError.h"
Oui, également besoin de l'espace de noms std; – numerical25