标签: c++ syntax
string foo() const = 0;
这个函数声明究竟是什么意思?特别是什么是' = 0'好的,因为函数未被声明为虚拟?
答案 0 :(得分:3)
= 0是该函数是纯虚函数的语法。据我所知,声明还需要在关键字virtual之前。
更多关于此的内容:What does it mean to set the declaration of a function equal to 0? How can you assign an integer to a function?
Difference between a virtual function and a pure virtual function