标题:C++面试题,有空的来看看。
只看楼主
JMGS0013
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2005-7-14
 问题点数:0 回复次数:2 
C++面试题,有空的来看看。
C/C++ 1) Write a class that implements a simple list. It must provide methods to add and remove values, and provide some way to iterate through all elements in the list. 2) Write destructors for these two classes. class A { public: int *a; A() { a = new int[10]; } }; class B : public A { public: int *b; B() { b = new int[20]; } }; 3) Given the following definition, write a constructor that sets the value of m_constant. class CConstant { public: const int m_constant; const int Get() {return m_constant; } }; 4) Write a copy constructor for the Circle class defined below. In what two situations does the C++ compiler use the copy constructor implicitly? class Circle { public: Circle(); int center_x; inst center_y; double r; }; 5) What is a hash table? What is its purpose, and how does it function? 6) What does mysteryFunction return? int mysteryFunction ( int n) { int k = 0; while( n ) { k++; n = n / 10; } return k; }
搜索更多相关主题的帖子: 面试 
2005-08-08 09:50
Stayor
Rank: 1
等 级:新手上路
帖 子:137
专家分:0
注 册:2005-8-4
得分:0 
题不是很难,就是英文比较讨厌。不知道这是哪得面试题。
2005-08-09 20:52
Murray
Rank: 1
等 级:新手上路
帖 子:101
专家分:0
注 册:2005-4-10
得分:0 
很基础的题哈
是不是就是考你的英语水平吧

2005-08-14 15:10



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-24616-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.168327 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved