MOTO
1、智能指针,com实现的原理,
2、printf()可变参数如何实现
3、标准模板库vector追加数据如何实现。是底层如何实现,不能用现有的东东。
4、还有,java的垃圾收集机制如何实现为什么?如果是你自己实现垃圾收集机制,如何实
现? 用什么数据结构。
5、二叉排序树和哈希表那个查找效率高,实用于pda 。
6、.net的底层实现机制。
7、进程间通信如何实现。
8、还有迭代问题,什么问题用迭代,迭代在操作系统中如何实现的 。
9、如何交换两个变量,不能用中间变量。
10、c与c++static函数的区别???
11、const 函数的作用,如何实现钩子函数。
12、两层容错技术怎么实现?
13、写出函数指针,函数返回指针,const指针,指向const的指针,指向const的const指针.
14、函数调用如何实现,注意什么问题。
15、指针和引用的差别,
16、拷贝构造函数如何实现,什么情况下会用到。
*******************************unkonw**************************************************************************
C++ does not have an “interface” keyword. How do you create an interface in C++?
Where/when is the use of interfaces especially helpful?
5. What does it mean to say that a function is reentrant?
What are some of the ways of achieving re-entrancy?
struct S
{
int i;
int * p;
};
void main()
{
struct S s;
int * p = &s.i;
p[0] = 4;
p[1] = 3;
s.p = p;
s.p[1] = 1;
s.p[0] = 2;
}
问程序会在哪一行死掉。
分析:这道题有点难度。如果你对指针掌握的不错的话,仔细分析,相信最终还是可以迎刃而解的。下面就来逐条分析
struct S s;
int * p = &s.i;/*取成员s.i的地址*/
p[0] = 4;;/*设置成员s.i为4。因为指针p指向i地址,p[0]指向i*/
p[1] = 3;/*设置成员s.p为3。因为p[0]指向s.i,p[1]指向指针s.p*/
s.p = p;/*重新设置指针s.p为s.i的地址*/
s.p[1] = 1;/*置s.p指针为1。因前面s.p指向s.i的地址,固s.p[1]指向s.p*/
s.p[0] = 2;/*因为s.p指针已经通过前面被设置为1,即非法地址,所以s.p[0]想通 过s.p去访问s.i显然是非法的。*/