- 博客(7)
- 收藏
- 关注
原创 Exchange Nodes
Problem: Exchange the odd and even nodes in a linked list.Given a "head" pointer to a linked list. You are asked to write a C/C++ function to exchange the odd and even nodes in the linked list. For ex
2005-10-22 08:50:00 773
原创 Partially Revert Linked List
Problem: partially revert a linked listGiven a HEAD pointer to a linked list and an OFFSET pointer pointing to a node in the linked list. You are asked to write a C/C++ subroutine to revert the part o
2005-10-22 08:48:00 771
原创 Find Common Ancestor
Problem: find the common ancestor of two nodes in a treeGiven a "tree" pointer pointing to the root node of a tree and the other two pointers to two nodes in the tree. You are expected to write a C++
2005-10-22 08:46:00 854
原创 重温C++之虚拟析构函数
虚拟函数的引入是为了实现多态性(polymorphism),而虚拟析构函数是怎么实现多态性的?我想通过以下例子进行说明。#include using namespace std;class employee{public: employee(){ cout } ~employee(){ cout }};class programmer: public employee{public: pr
2005-10-22 08:35:00 905
原创 Boost库在XP+Visual C++.net中的安装
本人的机子是window xp系统,并安装了Visual Studio Dot Net2003中文版(个人还是偏好英文版,不过没下到). 其中Visual Studio Dot Net2003中文版的安装路径是D:/Program Files/Microsoft Visual Studio .NET 2003我的安装过程是:1.从www.boost.org中下载了boost_1_32_0.zip,
2005-05-19 08:22:00 1189
原创 重载标题栏中的最小化、最大化
这个功能一般很少用,但网上经常有人问起。其方法较简单,主要是通过重载OnSysCommand函数实现。消息WM_SYSCOMMAND映射到OnSysCommand函数。重载最小化示例如下:OnSysCommand(UINT nID, LPARAM lParam){ if ( nID == SC_MINIMIZE ) { //insert y
2005-04-20 15:55:00 836
原创 屏蔽Dialog对话框中的Esc和Enter键的思路
在MFC所生成的对话框程序中,默认的按下Esc键会导致程序退出,而按下Enter会使程序查找对话框的焦点落在哪个按扭上,从而执行该按钮的按下操作。 为了屏蔽这两个键可以通过重载PreTranslaMessag函数。具体如下:BOOL CMCIsingDlg::PreTranslateMessage(MSG* pMsg){ if( pMsg->message == WM
2005-04-20 08:56:00 1544 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人