📄 tplex.cpp
字号:
#include "TPlex.h"
/////////////////////////////////////////////////////////////////////////////
// TPlex
TPlex * TPlex::Create( TPlex*& pHead, TUINT nMax, TUINT cbElement )
{
//MYASSERT( nMax > 0 && cbElement > 0 );
TPlex * p = (TPlex *) new TBYTE[sizeof(TPlex) + nMax * cbElement];
// may throw exception
if( p==TNULL )
{
//char szException[TMAX_PATH + 10] = {0};
//sprintf( szException,"%s:%d",__FILE__,__LINE__ );
//printf( szException );
return TNULL;
}
p->pNext = pHead;
pHead = p; // change head (adds in reverse order for simplicity)
return p;
}
void TPlex::FreeDataChain() // free this one and links
{
TPlex* p = this;
while( p != NULL )
{
TBYTE * bytes = (TBYTE*) p;
TPlex * pNextLoacal = p->pNext;
delete[] bytes;
p = pNextLoacal;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -