![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++笔试题
notebook_p
这个作者很懒,什么都没留下…
展开
-
反转链表
//将一个链表反转#include #include #include using namespacestd;templateclassNODETYPE>classList;templateclassNODETYPE>class ListNode{ friend class ListNODETYPE>;public:原创 2013-04-24 11:09:21 · 430 阅读 · 0 评论 -
在main执行完后执行的代码
//main执行完后执行int fn1(void);int fn2(void);int fn3(void);int fn4(void); void main(void){ _onexit(fn4); _onexit(fn3); _onexit(fn2); _onexit(fn1); cout转载 2013-04-24 16:30:05 · 467 阅读 · 0 评论 -
经典C++笔试题收藏
1.求下面函数的返回值(微软)int func(x) { int countx = 0; while(x) { countx ++; x = x&(x-1); } return countx; } 假定x = 9999。 答案:8思路:将x转化为2进制,看含有的1的个数转载 2013-04-24 17:17:12 · 636 阅读 · 0 评论 -
String类成员方法实现
//实现String类的成员方法class String{public: String( const char* str =NULL ) // 普通构造 ~String(); //析构 String( const String& other); //拷贝构造函数 String& operater=(const原创 2013-04-24 14:46:49 · 454 阅读 · 0 评论