雅虎笔试题
2. 1024 bytes
3. 512 bytes
4. 4096 bytes
5. 1024 bits
question 36. (单选)
以下运算符不能被重载的是:
1. !=
2. ->
3. []
4. ()
5. ::
question 37. (多选)
以下哪一个不是stl所提供的容器?
1. vector
2. deque
3. complex
4. list
5. properties
question 38. (单选)
选项中填入以下代码段中(1)处编译无法通过的是:
template
class screen { };
template
class screen { };
template
class screen { };
template
class screen { };
int main()
{
______(1)________
}
1. screen s1;
2. screen s2;
www.qz26.com
3. screen s3;
4. screen s4;
5. screen s5;
question 39. (单选)
以下哪个容器默认分配的是不间断连续空间?
1. vector
2. list
3. deque
4. stack
5. queue
question 40. (单选)
set的底层数据结构是:
1. red black tree
2. red white tree
3. green black tree
4. green white tree
5. black white tree
question 41. (多选)
子类不能从父类继承的有:
1. 构造函数
2. 拷贝构造函数
3. 析构函数
4. 友元函数
5. 静态成员函数
question 42. (多选)
面向对象语言的一般特性有:
1. 封装
2. 组合
3. 继承
4. 多态
5. rtti
question 43. (单选)
下段代码的输出结果是:
#include
using namespace std;
int main()
{
char a[] = "abcdef";
char *b = "123456";
cout << sizeof(a) << " "
<< sizeof(a[1]) << " "< br><< sizeof(a+1) << " "
<< sizeof(*(a+1)) << " "
<< sizeof(b) << " "
<< sizeof(b[1]) << " "
<< sizeof(b+1) << " "
<< sizeof(*(b+1)) << endl;
}
1. 4 1 4 1 4 1 4 1
2. 7 1 4 1 4 1 4 1
3. 7 1 4 1 7 1 4 1
4. 4 1 5 1 4 1 5 1
5. 7 1 5 1 4 1 5 1
question 44. (单选)
以下选项放入(1)处编译不能通过的是:
class a {
private:
www.qz26.com
int num;
public:
a(int n):num(n) {}
_______(1)_______
};
1. const void set(int n) { num = n; }
2. void set(const int n) { num = n; }
3. void set(int const n) { num = n; }
4. void set(int n) const { num = n; }
5. void set(const int& n) { num = n; }
question 45. (多选)
以下选项中代入(1)处编译不能通过的有:
#include
using namespace std;
class a {};
class b : public a {};
int main()
{
________(1)________
}
1. pb = const_cast(pa);
2. pb = static_cast(pa);
3. pb = dynamic_cast(pa);
4. pb = reinterpret_cast(pa);
5. pb = (b*)(pa);
question 46. (单选)
如果石油供应危机导致国际市场油价上涨,那么市场开放的某些国家,如美国,油价也上涨,不管这些国家的石油是全部依赖进口还是全部自产。如果上述有关石油危机的描述为真,那么以下哪项政策如能被市场开放的。国家所采纳,则最有可能减轻国际市场油价意外急剧上涨时对该国经济的长期影响?