intnode.cpp
来自「异质链表 的实现 实现异质链表的查找、插入、删除和遍历」· C++ 代码 · 共 38 行
CPP
38 行
// IntNode.cpp: implementation of the CIntNode class.
//
//////////////////////////////////////////////////////////////////////
#include "IntNode.h"
#include "iostream.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CIntNode::CIntNode(int ivalue)
: m_iValue(ivalue)
{
}
CIntNode::~CIntNode()
{
}
void* CIntNode::Visit()
{
cout << m_iValue << endl;
return &m_iValue;
}
bool CIntNode::operator==(const CNodeBase* base)
{
CNodeBase* pBase = const_cast<CNodeBase*>(base);
CIntNode* pNode = dynamic_cast<CIntNode*>(pBase);
if(pNode==0)
return false;
if( pNode->m_iValue == this->m_iValue)
return true;
else
return false;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?