14.1 In terms of inheritance, what is the effect of keeping a constructor private?这道题问我们用继承特性时,如果建立一个私有的构建函数会怎样。只有能访问该函数的私有变量或函数的东西才能访问私有构建函数,比如内部类就可以...
分类:
其他好文 时间:
2015-11-06 14:46:28
阅读次数:
153
13.10 Write a function in C called my2DAlloc which allocates a two-dimensional array. Minimize the number of calls to malloc and make sure that the me...
分类:
编程语言 时间:
2015-11-04 07:01:50
阅读次数:
287
13.9 Write an aligned malloc and free function that supports allocating memory such that the memory address returned is divisible by a specific power ...
分类:
其他好文 时间:
2015-11-03 08:03:48
阅读次数:
234
13.8 Write a smart pointer class. A smart pointer is a data type, usually implemented with templates, that simulates a pointer while also providing au...
分类:
其他好文 时间:
2015-11-02 15:16:48
阅读次数:
179
13.7 Write a method that takes a pointer to a Node structure as a parameter and returns a complete copy of the passed in data structure. The Node data...
分类:
其他好文 时间:
2015-11-02 13:52:43
阅读次数:
245
13.6 Why does a destructor in base class need to be declared virtual?这道题问我们为啥基类中的析构函数要定义为虚函数。首先来看下面这段代码:class Foo {public: void f();};class Bar: pu...
分类:
其他好文 时间:
2015-10-31 08:00:23
阅读次数:
155
13.5 What is the significance of the keyword "volatile" in C这道题考察我们对于关键字volatile的理解,顾名思义,volatile有易变的易挥发的意思,在C/C++里,表示告知编译器某个变量可能会由程序外部改变,比如操作系统,硬件或者其...
分类:
其他好文 时间:
2015-10-31 06:54:08
阅读次数:
170
13.2 Compare and contrast a hash table and an STL map. How is a hash table implemented? If the number of inputs is small, which data structure options...
分类:
其他好文 时间:
2015-10-30 07:05:02
阅读次数:
232
12.3 We have the following method used in a chess game: boolean canMoveTo( int x, int y). This method is part of the Piece class and returns whether o...
分类:
移动开发 时间:
2015-10-25 10:49:09
阅读次数:
224
12.2 You are given the source to an application which crashes when it is run. After running it ten times in a debugger, you find it never crashes in t...
分类:
其他好文 时间:
2015-10-24 12:54:26
阅读次数:
188