当我在C中编译我的项目时,MSVC抛出以下错误:
error #94: the size of an array must be greater than zero
在执行sizeof时,在以下行中抛出错误:
if (sizeof (MyNamespace::MyClass) == 60)
因此定义了MyClass:
class MyClass: public ParentClass
{
public:
MyClass( void *pCreate, int a, int b, bool c) :
ParentClass( pCreate, a, b, c ) {}
virtual inline void myFunc ( )
{
//something
}
private:
virtual ~MyClass(){};
/**
* Copy assignment. Intentionally made private and not implemented to prohibit usage (noncopyable stereotype)
*/
MyClass& operator=(const MyClass&);
};
谁能告诉我可能出错的是什么?即使sizeof返回零大小,为什么它是编译器错误?