ptlist.cpp

来自「故障诊断工作涉及的领域相当广泛」· C++ 代码 · 共 50 行

CPP
50
字号
// ptlist.cpp: implementation of the ptlist class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "richtest.h"
#include "ptlist.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

ptlist::ptlist()
{
head=tail=pdpt=NULL;
}

ptlist::~ptlist()
{
	pdpt=head;
	while(pdpt!=NULL)
	{
	delete pdpt;
	pdpt=pdpt->next;
	}
}

BOOL ptlist::add()
{	dpt* p=new dpt;
	if(p==NULL)
	return FALSE;
	if(head==NULL)
	{
	head=p;
	pdpt=head;
	}
	else
	{
	pdpt->next=p;
	pdpt=p;
	tail=p;
	}
	return TRUE;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?