こんにちは、C++の初心者です。 私のプロジェクトでは、C#のようなenum値を使用する必要があります。C++の列挙型で定義の構造体エラーが発生しました
enum Attributes
{
_BINARY = 0x26,
_UNSIGNED = 0x27
};
私の例機能
void MyLDC::CreateTable(string tablename,string primaryKey)
{
//Simple Row Implementation
row->name = "Example Row";
row->AutoIncrement = true;
row->primaryKey = true;
row->comment = "Example Row";
row->attrib = Attributes::_UNSIGNED;
属性::マイ構造体
struct Rows
{
string name;
bool primaryKey;
int lenght;
string defined;
MyLDC::Attributes attrib;
bool Nullable;
bool AutoIncrement;
string comment;
};
Rows rw;
Rows* row = &rw;
MyLDC私は=属性行優先> ATTRIB :: _ UNSIGNED上のエラーを取得します。
このエラーは考えられません。 誰が正しい解決策ですか?
あなたはどうしますか?問題の本文に完全なエラーと完全ではないエラーを含めてください。 –
エラーとは無関係に、アンダースコアで始まり大文字で始まるシンボル名は、実装(コンパイラおよび標準ライブラリ)用に予約されています。例えば、 [この古いSO答えの詳細について](http://stackoverflow.com/a/228797/440558)。 –
エラー:属性はクラスまたは名前空間ではありません。 –