| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 836 人关注过本帖
标题:C++面试题,有空的来看看。
取消只看楼主 加入收藏
JMGS0013
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2005-7-14
收藏
 问题点数:0 回复次数:0 
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
快速回复:C++面试题,有空的来看看。
数据加载中...
 
   



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

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