由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - what is the problem with the following code examples?
相关主题
C++ online Test 一题请问有没有面试过关于derivative的问题的?
请问一道c++题目各位总结一下区别:virtual function and virtual destructor?
问个关于c++ auto_pter的问题C++ 一小题
C++ Q22: ostreamBloomberg phone interview (intern)
请教 什么 是 operations strategist ?c++ class default functions?
请教2道c++的题 (转载)大家帮我看看我的recruiter是在帮我还是在玩我?
这道题怎么做的?Divide a number by 3 without using *, /, +, -, % operators [转载]
hehe弱问一下,cracking the coding interview上有关bit manipulation的解释正确么
相关话题的讨论汇总
话题: fooderived话题: foo话题: tvar话题: what话题: class
进入JobHunting版参与讨论
1 (共1页)
S**Y
发帖数: 136
1
question 1:
template
class Foo
{
T tVar;
public:
Foo(T t) : tVar(t) { }
};
class FooDerived : public Foo { };
FooDerived fd;
What is preventing the above code from being legal C++?
A. FooDerived is a non-template class that derives from a template class.
B. tVar is a variable of an unknown type.
C. A constructor must be provided in FooDerived.
D. FooDerived uses the non-C++ type std::string.
E. The initialization of tVar occurs outside the body of Foo's const
d****z
发帖数: 53
2

FooDerived has no proper constructor, needs to write one
constructor.
a
oper
destructor.
Since it's a pure virtual function, should not be called in the destructor

illega
no

【在 S**Y 的大作中提到】
: question 1:
: template
: class Foo
: {
: T tVar;
: public:
: Foo(T t) : tVar(t) { }
: };
: class FooDerived : public Foo { };
: FooDerived fd;

1 (共1页)
进入JobHunting版参与讨论
相关主题
弱问一下,cracking the coding interview上有关bit manipulation的解释正确么请教 什么 是 operations strategist ?
Amazon China Operation Manager Position请教2道c++的题 (转载)
我公司在招 DevOps Sr. Operations Software Engineer这道题怎么做的?
Amazon team match的问题hehe
C++ online Test 一题请问有没有面试过关于derivative的问题的?
请问一道c++题目各位总结一下区别:virtual function and virtual destructor?
问个关于c++ auto_pter的问题C++ 一小题
C++ Q22: ostreamBloomberg phone interview (intern)
相关话题的讨论汇总
话题: fooderived话题: foo话题: tvar话题: what话题: class