Ema*_*res 0 c++ oop compilation class
我想了解如何在C++中编译类.
为什么下面的代码编译成功?是否Foo()需要编译实现才能成功?
Foo()
class Test{ public: Test() {} int Foo(); }; int main() { Test obj; return 0; }
Kar*_*ath 7
没有人试图调用Foo,因此链接器不会抱怨缺少实现,因为它不需要.
Foo
如果你写了virtual int Foo();,你会看到链接器错误.
virtual int Foo();
归档时间:
14 年 前
查看次数:
129 次
最近记录: