你好,我是C++的新手。 對於我的項目,我需要使用類似C#示例的枚舉值。C++枚舉結構錯誤的定義
我的結構
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 ::屬性
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;
我上行級別>屬性=獲取錯誤屬性:: _ UNSIGNED;
不知道這個錯誤。 誰是正確的解決方案?
而且*你得到了什麼*錯誤?請在問題主體中提供完整的和未經編輯的錯誤。 –
與您的錯誤無關,爲實現(編譯器和標準庫)保留以下劃線開頭且後跟大寫字母的符號名稱。見例如[這個老的答案的更多信息](http://stackoverflow.com/a/228797/440558)。 –
錯誤:屬性'不是類或名稱空間| –