c++出错记录
错误1如下:
vector<vector<int>> m_vc; error: '&' cannot appear in a constant-expression
即嵌套的模板中,最后面的两个尖括号不能挨着写,正确写法如下
vector<vector<int> > m_vc;
错误2如下:
MyDbHandle.cpp:253: error: invalid conversion from 'short int' to 'char*'
MyDbHandle.cpp:253: error: initializing argument 2 of 'virtual TINT32 DCDBSQL::GetValue(TINT32, char*)'
MyDbHandle.cpp:256: error: invalid conversion from 'int' to 'char*'
MyDbHandle.cpp:256: error: initializing argument 2 of 'virtual TINT32 DCDBSQL::GetValue(TINT32, char*)'
MyDbHandle.cpp:259: error: invalid conversion from 'TINTL' to 'char*'
MyDbHandle.cpp:259: error: initializing argument 2 of 'virtual TINT32 DCDBSQL::GetValue(TINT32, char*)'
MyDbHandle.cpp:330: warning: deprecated conversion from string constant to 'char*'
MyDbHandle.cpp:253: error: initializing argument 2 of 'virtual TINT32 DCDBSQL::GetValue(TINT32, char*)'
MyDbHandle.cpp:256: error: invalid conversion from 'int' to 'char*'
MyDbHandle.cpp:256: error: initializing argument 2 of 'virtual TINT32 DCDBSQL::GetValue(TINT32, char*)'
MyDbHandle.cpp:259: error: invalid conversion from 'TINTL' to 'char*'
MyDbHandle.cpp:259: error: initializing argument 2 of 'virtual TINT32 DCDBSQL::GetValue(TINT32, char*)'
MyDbHandle.cpp:330: warning: deprecated conversion from string constant to 'char*'
头文件有其他几个纯虚实现,代码调用却都找不到。
基类的纯虚接口子类没有定义时无法通过子类调用
static成员变量访问规则
类成员只能由类对象来访问,static成员不属于任何一个对象,可以不依赖于类对象进行访问,但类外不能访问私有的static对象,想要在全局域直接初始化的static成员变量要设成public成员。
错误
expected unqualified-id before 'using'
定义类的时候没有加分号