trace.cpp

来自「采用距离反比加权算法」· C++ 代码 · 共 53 行

CPP
53
字号
// Trace.cpp: implementation of the CTrace class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Test.h"
#include "Trace.h"

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

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

CTrace::CTrace()
{
  m_pData=NULL;
}

CTrace::~CTrace()
{
	if(m_pData!=NULL)
	{
		free1double(m_pData);
		m_pData=NULL;
	}

}
void *CTrace::alloc1 (size_t n1, size_t size)
{
	void *p;
	
	if ((p=malloc(n1*size))==NULL)
		return NULL;
	return p;
}
double *CTrace::alloc1double(size_t n1)
{
	return (double*)alloc1(n1,sizeof(double));
}
void CTrace::free1 (void *p)
{
	free(p);
}
void CTrace::free1double(double *p)
{
	free1(p);
}

⌨️ 快捷键说明

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