由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 几个多次被问到的c++问题请教
相关主题
Phone Interview面经面试就是面试问题,跟实际问题差太远
[板上牛人多]问个算法题A公司面挂了,发面经,攒RP
一个GOOG的二叉树面试题攒人品,Amazon 二面面经
google phone screen提供一个full time面经吧,小公司面试比大公司虐多了
Yahoo、 Google、LinkedIn电面题目 & 面试经验求助问到G家题
LC的BST iterator到底要考察什么?A家电面
请教,c++ primer plus是要先看完再刷题吗?一般电面C++会问到什么专业问题?
我想了想两个programming pearls的习题请教
相关话题的讨论汇总
话题: 初始化话题: inialize话题: struct话题: inialized话题: list
进入JobHunting版参与讨论
1 (共1页)
b********e
发帖数: 215
1
1. what is the diff between struct and class? my answer is member variable
in struct is public by default, but class is private, but the interviewer
usually isn't satisfied about this answer.
Is there any other diffs?
2. map用什么实现的?
3. 在构造函数中,在inialize list里初始化成员变量相比在函数体中初始化有什么好处?
4。什么类型的成员变量必须在inialize list中初始化,我回答reference type have to be inialized, what else?
l*******y
发帖数: 1498
2
1. 还有的话就是inheritance一个public一个private by default. 别的都一样了吧?
2. stl map? 是一个balanced BST, look up time是 log(n)
f*****y
发帖数: 444
3
1. member function also default to public.
3. initialization list also faster. One step only: it creates the variable
with the initial value. in function, it has two steps, you create the
variable with default value then need do the assignment.
4. const member variables.
v***n
发帖数: 5085
4

2 RB tree, but u do not have to know the details about RB tree.

【在 l*******y 的大作中提到】
: 1. 还有的话就是inheritance一个public一个private by default. 别的都一样了吧?
: 2. stl map? 是一个balanced BST, look up time是 log(n)

h**k
发帖数: 3368
5
如果需要调用基类的有参数的构造函数,也必须在initialization list里调用。

【在 f*****y 的大作中提到】
: 1. member function also default to public.
: 3. initialization list also faster. One step only: it creates the variable
: with the initial value. in function, it has two steps, you create the
: variable with default value then need do the assignment.
: 4. const member variables.

c***2
发帖数: 838
6
diff between struct and class: inheritance

好处?
have to be inialized, what else?

【在 b********e 的大作中提到】
: 1. what is the diff between struct and class? my answer is member variable
: in struct is public by default, but class is private, but the interviewer
: usually isn't satisfied about this answer.
: Is there any other diffs?
: 2. map用什么实现的?
: 3. 在构造函数中,在inialize list里初始化成员变量相比在函数体中初始化有什么好处?
: 4。什么类型的成员变量必须在inialize list中初始化,我回答reference type have to be inialized, what else?

1 (共1页)
进入JobHunting版参与讨论
相关主题
两个programming pearls的习题请教Yahoo、 Google、LinkedIn电面题目 & 面试经验求助
一些oop的概念LC的BST iterator到底要考察什么?
C++定义数组长度可以写成int a[n]吗?请教,c++ primer plus是要先看完再刷题吗?
adobe coding Test我想了想
Phone Interview面经面试就是面试问题,跟实际问题差太远
[板上牛人多]问个算法题A公司面挂了,发面经,攒RP
一个GOOG的二叉树面试题攒人品,Amazon 二面面经
google phone screen提供一个full time面经吧,小公司面试比大公司虐多了
相关话题的讨论汇总
话题: 初始化话题: inialize话题: struct话题: inialized话题: list