【发布时间】:2016-10-28 10:04:15
【问题描述】:
你好,我是 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;
我在 row->attrib = Attributes::_UNSIGNED; 上遇到错误;
不知道这个错误。 谁是正确的解决方案?
【问题讨论】:
-
你得到什么错误?请在问题正文中包含完整且未经编辑的完整错误。
-
与您的错误无关,以下划线开头并后跟大写字母的符号名称保留用于实现(编译器和标准库)。参见例如this old SO answer for more information.
-
错误:属性'不是类或命名空间|