当前位置: 首页>>代码示例>>C++>>正文


C++ DeleteArray函数代码示例

本文整理汇总了C++中DeleteArray函数的典型用法代码示例。如果您正苦于以下问题:C++ DeleteArray函数的具体用法?C++ DeleteArray怎么用?C++ DeleteArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DeleteArray函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Read

	bool Read()
	{
		Conn->Read((char*) Protocol, sizeof(Protocol), 0);
		Command = ReadUShort();
		Status.Status = ReadULong();
		Flags = ReadUChar();
		Flags2 = ReadUShort();
		Conn->Read((char*) Pad, sizeof(Pad), 0);
		Tid = ReadUShort();
		Pid = ReadUShort();
		Uid = ReadUShort();
		Mid = ReadUShort();
		
		WordCount = ReadUChar();
		DeleteArray(ParameterWords);
		ParameterWords = new ushort[WordCount];
		if (ParameterWords)
		{
			Conn->Read((char*) ParameterWords, sizeof(ushort)*WordCount, 0);
		}

		ByteCount = ReadUChar();
		DeleteArray(Buffer);
		Buffer = new uchar[ByteCount];
		if (Buffer)
		{
			Conn->Read((char*) Buffer, sizeof(uchar)*ByteCount, 0);
		}

		return true;
	}
开发者ID:FEI17N,项目名称:Lgi,代码行数:31,代码来源:ISmb.cpp

示例2: backtrace

int OS::StackWalk(Vector<OS::StackFrame> frames) {
  int frames_size = frames.length();
  void** addresses = NewArray<void*>(frames_size);

  int frames_count = backtrace(addresses, frames_size);

  char** symbols;
  symbols = backtrace_symbols(addresses, frames_count);
  if (symbols == NULL) {
    DeleteArray(addresses);
    return kStackWalkError;
  }

  for (int i = 0; i < frames_count; i++) {
    frames[i].address = addresses[i];
    // Format a text representation of the frame based on the information
    // available.
    SNPrintF(MutableCStrVector(frames[i].text, kStackWalkMaxTextLen),
             "%s",
             symbols[i]);
    // Make sure line termination is in place.
    frames[i].text[kStackWalkMaxTextLen - 1] = '\0';
  }

  DeleteArray(addresses);
  free(symbols);

  return frames_count;
}
开发者ID:BlitzMaxModules,项目名称:axe.mod,代码行数:29,代码来源:platform-freebsd.cpp

示例3: min

bool GRegion::SetSize(int s)
{
	bool Status = true;

	if (s > Alloc)
	{
		int NewAlloc = (s + 15) & (~0xF);
		GRect *Temp = new GRect[NewAlloc];
		if (Temp)
		{
			int Common = min(Size, s);
			memcpy(Temp, a, sizeof(GRect)*Common);
			DeleteArray(a);
			a = Temp;
			Size = s;
			Alloc = NewAlloc;
		}
		else
		{
			Status = false;
		}
	}
	else
	{
		Size = s;
		if (!Size)
		{
			DeleteArray(a);
			Alloc = 0;
		}
	}

	return Status;
}
开发者ID:FEI17N,项目名称:Lgi,代码行数:34,代码来源:GRect.cpp

示例4: DeleteArray

CMotion::~CMotion()
{
	DeleteArray(m_attributes);
	DeleteArray(m_paths);
	DeleteArray(m_bones);
	DeleteArray(m_animations);
	DeleteArray(m_frames);
}
开发者ID:Aishiro,项目名称:ATools,代码行数:8,代码来源:Motion.cpp

示例5: DeleteArray

ArcScriptCreatureAI::~ArcScriptCreatureAI()
{
	DeleteArray(mOnDiedEmotes);
	DeleteArray(mOnTargetDiedEmotes);
	DeleteArray(mOnCombatStartEmotes);
	DeleteArray(mOnTauntEmotes);
	DeleteArray(mSpells);
}
开发者ID:AegisEmu,项目名称:AegisEmu,代码行数:8,代码来源:Base.cpp

示例6: GetCycle

/*
*****************************************************************************
**函 数 名:Uint8 GetCycle(Uint8 *p,Uint8 n)
**功能描述:算周期
**输    入:Uint8 *p,Uint8 n
**输    出:
*****************************************************************************
*/
Uint8 GetCycle(Uint8 *p,Uint8 n)                //算周期
{
	Uint8 xdata i,j,account,condition,tempMin,posMin,posMax;
	Uint16 xdata tempMax;
	Uint8 xdata cycle = 0;

	condition =(Uint16)(SerialMore(p,n)+SerialLess(p,n))*4/5;
	for(i=MIN_POINT;i<=MAX_POINT;i++)
	{
		CalculateArea(p,i);
		account=FindLeastValue(GatDat->Area,TOTAL-i);
		while(account>=3)
		{
			tempMin = 0xff;
			posMin = 0;
			for(j=0;j<(account-1);j++)
			{
				if(abs(GatDat->Num[j+1]-GatDat->Num[j])<tempMin)
				{
					tempMin = abs(GatDat->Num[j+1]-GatDat->Num[j]);
					posMin  = j;
				}
			}
			if(tempMin<condition)
			{
				if(GatDat->Area[GatDat->Num[posMin]] > GatDat->Area[GatDat->Num[posMin+1]])
					DeleteArray(account,posMin);
				else
					DeleteArray(account,posMin+1);
				account --;
			}
			else
			{
				cycle=DistanceEqu(account);
				if(cycle)
					return cycle;
				else
				{
					tempMax = 0;
					posMax = 0xff;
					for(j=0;j<account;j++)
					{
						if(GatDat->Area[GatDat->Num[j]]>=tempMax)
						{
							tempMax = GatDat->Area[GatDat->Num[j]];
							posMax  = j;
						}
					}
					DeleteArray(account,posMax);
					account --;
				}
			}
		}
	}
	return 0;
}
开发者ID:wind1024,项目名称:SWZ,代码行数:64,代码来源:calculate.c

示例7: DeleteArray

CProject::~CProject()
{
	Project = null;

	for (int i = 0; i < m_waterListCount; i++)
	{
		DeleteArray(m_waterLists[i].textures);
		DeleteArray(m_waterLists[i].textureIDs);
	}
	DeleteArray(m_waterLists);
}
开发者ID:Aishiro,项目名称:ATools,代码行数:11,代码来源:Project.cpp

示例8: switch

void ArcScriptCreatureAI::RemoveAllEmotes(EventType pEventType)
{
	switch( pEventType )
	{
		case Event_OnCombatStart:	DeleteArray(mOnCombatStartEmotes); break;
		case Event_OnTargetDied:	DeleteArray(mOnTargetDiedEmotes); break;
		case Event_OnDied:			DeleteArray(mOnDiedEmotes); break;
		case Event_OnTaunt:			DeleteArray(mOnTauntEmotes); break;
		default:					sLog.outDebug("ArcScriptCreatureAI::RemoveAllEmotes() : Invalid event type!\n"); break;
	}
}
开发者ID:AegisEmu,项目名称:AegisEmu,代码行数:11,代码来源:Base.cpp

示例9: DeleteArray

TextLock::~TextLock()
{
	DeleteArray(Line);
	if (LineW)
	{
		for (int i=0; i<Lines; i++)
		{
			DeleteArray(LineW[i]);
		}
		DeleteArray(LineW);
	}
}
开发者ID:FEI17N,项目名称:Lgi,代码行数:12,代码来源:GText.cpp

示例10: DeleteArray

HRESULT AllocMeshHierarchy::DestroyFrame( THIS_ D3DXFRAME* pFrameToFree)
{
	DeleteArray(pFrameToFree->Name) ;
	Delete(pFrameToFree) ;

	return D3D_OK ;
}
开发者ID:JumSSang,项目名称:Kinect,代码行数:7,代码来源:AllocMeshHierarchy.cpp

示例11: LgiToNativeCp

bool GCombo::Insert(char *p, int Index)
{
	bool Status = false;

	if (p)
	{
		if (Handle())
		{
			char *n = LgiToNativeCp(p);
			if (n)
			{
				if (Index < 0)
				{
					Index = GetItems();
				}

				Status = SendMessage(Handle(), CB_INSERTSTRING, Index, (long)n) == Index;
				DeleteArray(n);
			}
		}
		else
		{
			d->InitStrs.Insert(NewStr(p), Index);
			Status = true;
		}
	}

	return Status;
}
开发者ID:FEI17N,项目名称:Lgi,代码行数:29,代码来源:GCombo.cpp

示例12: memset

bool TextDocument::SetLength(int Len)
{
	bool Status = TRUE;

	if (Len + 1 > Alloc)
	{
		int NewAlloc = (Len + TEXT_BLOCK) & (~TEXT_MASK);
		char *Temp = new char[NewAlloc];
		if (Temp)
		{
			memset(Temp + Length, 0, NewAlloc - Length);
			memcpy(Temp, Data, Length);
			DeleteArray(Data);
			Data = Temp;
			Length = Len;
			Alloc = NewAlloc;
		}
		else
		{
			Status = FALSE;
		}
	}
	else
	{
		// TODO: resize Data to be smaller if theres a
		// considerable size change
		Length = Len;
	}

	return Status;
}
开发者ID:FEI17N,项目名称:Lgi,代码行数:31,代码来源:GText.cpp

示例13: va_start

void PrettyPrinter::Print(const char* format, ...) {
  for (;;) {
    va_list arguments;
    va_start(arguments, format);
    int n = OS::VSNPrintF(Vector<char>(output_, size_) + pos_,
                          format,
                          arguments);
    va_end(arguments);

    if (n >= 0) {
      // there was enough space - we are done
      pos_ += n;
      return;
    } else {
      // there was not enough space - allocate more and try again
      const int slack = 32;
      int new_size = size_ + (size_ >> 1) + slack;
      char* new_output = NewArray<char>(new_size);
      OS::MemCopy(new_output, output_, pos_);
      DeleteArray(output_);
      output_ = new_output;
      size_ = new_size;
    }
  }
}
开发者ID:18768108070,项目名称:pyv8,代码行数:25,代码来源:PrettyPrinter.cpp

示例14: Test

void Test(int row, int col, int bomb, int &y, int &x)
{
	struct pole** src;
	src = CreateArray(row, col);
	if (src == NULL)
		cout << "Problem\n";
	Random(src, row, col, bomb);
		//	bool wygrana = IsWin(src, row, col, bomb);
	bool bomba = false;
	int zakryte = row*col; // zakryte pola
	while (zakryte != bomb) {
		Write(src, row, col, y, x);
		//CountFlags(src, row, col, bomb);
		//ShowCell(src, row, col, y, x);
		PressKey(src, row, col, bomb, y, x,zakryte);
		bomba = IfBomb(src, row, col, y, x);
		if (bomba == true) break;
		system("cls");
    }
	x = 0;
	y = 0;
	if (zakryte == bomb) { //warunek wygranej
		cout << "Gratulacje, wygrales!\n\n";
	}
	Write(src, row, col, y, x);
	cout << "\n";
	DeleteArray(&src, row);
}
开发者ID:redpeter,项目名称:SAPER,代码行数:28,代码来源:plansza.cpp

示例15:

GenerateSequence::GenerateRandom(int Size)
{
    if(Value != NULL) DeleteArray();
    Value = new int[Size];
    for(int i=0;i<Size;i++) Value[i]=RandomNumber();
    return 0;
}
开发者ID:Druggist,项目名称:SortApp,代码行数:7,代码来源:generatesequence.cpp


注:本文中的DeleteArray函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。