您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DeleteArray函数代码示例

51自学网 2021-06-01 20:26:30
  C++
这篇教程C++ DeleteArray函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例4: DeleteArray

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


示例5: DeleteArray

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


示例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,


示例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,


示例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,


示例9: DeleteArray

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


示例10: DeleteArray

HRESULT AllocMeshHierarchy::DestroyFrame( THIS_ D3DXFRAME* pFrameToFree){	DeleteArray(pFrameToFree->Name) ;	Delete(pFrameToFree) ;	return D3D_OK ;}
开发者ID:JumSSang,项目名称:Kinect,代码行数:7,


示例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,


示例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,


示例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,


示例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,


示例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,


示例16: f

byte *LoadFile(TCHAR const *filename, size_t *size){	byte *buf = null;	File f(filename, File::AccessRead);	if(f.IsValid())	{		size_t fsize = f.Size();		buf = new byte[fsize + sizeof(WCHAR)];		if(buf != null)		{			size_t s = f.Read(buf, fsize);			if(s != fsize)			{				DeleteArray(buf);			}			else			{				*((WCHAR *)(((char *)buf) + fsize)) = L'/0';				if(size != null)				{					*size = fsize;				}			}		}	}	return buf;}
开发者ID:cskilbeck,项目名称:Game,代码行数:27,


示例17: DeleteArray

void CWndControl::SetTexture(const string& filename, bool tiles){    m_textureName = filename;    m_tiles = tiles;    m_hasTexture = false;    m_texture = null;    DeleteArray(m_textureTiles);    if (m_textureName.isEmpty())        return;    if (m_tiles && GetTilesCount() > 0)    {        m_textureTiles = new CTexture*[GetTilesCount()];        memset(m_textureTiles, 0, sizeof(CTexture*) * GetTilesCount());        string temp;        const string name = m_textureName.left(m_textureName.size() - 6);        const string ext = m_textureName.right(4);        for (int i = 0; i < GetTilesCount(); i++)        {            temp = name % string().sprintf("%02d", i) % ext;            m_textureTiles[i] = TextureMng->GetGUITexture(temp);            if (m_textureTiles[i])                m_hasTexture = true;        }    }    else    {        m_texture = TextureMng->GetGUITexture(m_textureName);        if (m_texture)            m_hasTexture = true;    }}
开发者ID:delium,项目名称:ATools,代码行数:35,


示例18: while

//-----------------------------------------------------------------------------EStatus BaseArray::SetLength (INT  iLengthIn)  {  INT    iNewAllocSize = iAllocSize;  // calculate how much to grow the array.  while (iLengthIn > iNewAllocSize)    {    iNewAllocSize += iAllocInc;    };  // if more memory is to be allocated, allocate it, copy over old values, and delete old memory.  if (iNewAllocSize > iAllocSize)    {    VOID *  pNewArray = AllocArray (iNewAllocSize);    // Note:  Ideally you need to detect an allocation failure here and return a failure code.    if (pNewArray == NULL)  return (EStatus::kFailure);    INT     iOldAllocSize = iAllocSize;    VOID *  pOldArray     = pArray;    pArray = pNewArray;    iAllocSize = iNewAllocSize;    if (iOldAllocSize > 0)      {      CopyValues (pOldArray, 0, 0, iOldAllocSize);      DeleteArray (&pOldArray);      };    };  iLength = iLengthIn;  return (EStatus::kSuccess);  };
开发者ID:mduffor,项目名称:tedit,代码行数:34,


示例19: calc_interpolated_prob

void calc_interpolated_prob(arpa_lm_t *lm, arpa_lm_t *lm1, arpa_lm_t *lm2,fb_info* fb1,fb_info* fb2,double w1,double w2){	TBROWSE br;	id__t id[MAX_K];	char** words;	int k,j;	double p1,p2,p;	words=(char**)NewArray(MAX_K,MAX_WORD,sizeof(char));	for (k=1;k<=lm->n;k++) {		begin_browse(lm,k,&br);		j=0;		printf("/nProcessing %d-gram/n",k);		while (get_next_ngram(id,&br)) {		  j++;		  show_dot(j);			ids2words(words,id,k,lm->vocab);			p1=calc_prob(words,k,lm1,fb1);			p2=calc_prob(words,k,lm2,fb2);			p=w1*p1+w2*p2;			lm->probs[k-1][br.pos[k-1]-1]=log10(p);			/* comment out this probability correction			if(lm->probs[k-1][br.pos[k-1]-1]==0.0){				lm->probs[k-1][br.pos[k-1]-1]=-0.00001;			}			*/		}	}	DeleteArray(words);}
开发者ID:QuinnEbert,项目名称:zedom8or,代码行数:33,


示例20: DeleteArray

ImmediateContext::~ImmediateContext(){	for(uint i=0; i<kNumBuffers; ++i)	{		::Release(mVertexBuffer[i]);		::Release(mConstantBuffer[i]);	}	DeleteArray(mCommandBuffer);}
开发者ID:cskilbeck,项目名称:Game,代码行数:9,


示例21: write_interpolated_lm

/**   Very similar to write_lms except that it use arpa_lm_t but not   lm_t.  Headers of the two files are also written.  */void write_interpolated_lm(arpa_lm_t *ng, const char* arpa_filename, const char* header1, const char* header2, int verbosity) {		  int i;  int j;  FILE* fp;  TBROWSE br;  id__t id[MAX_K];  char** words;    words=(char**)NewArray(MAX_K,MAX_WORD,sizeof(char));  if (words==NULL) {    Error ("Cannot allocate memory");    return;  }    if ((fp=fopen(arpa_filename,"w"))==NULL) {    Error ("Cannot open file to write arpa lm file.");    return ;  }	  /* HEADER */    pc_message(verbosity,1,"ARPA-style %d-gram will be written to %s/n",ng->n,arpa_filename);    write_arpa_copyright(fp,ng->n,(int) ng->vocab_size,ng->vocab[1],ng->vocab[2],ng->vocab[3]);  write_arpa_format(fp,ng->n);	  write_arpa_headers(fp, header1, header2);  write_arpa_num_grams(fp,NULL,ng,1);   /* Print 1-gram, ... n-gram info. */    for (i=0;i<=ng->n-1;i++) {        /* Print out the (i+1)-gram */		    write_arpa_k_gram_header(fp,i+1);        begin_browse(ng,i+1,&br);        /* Go through the n-gram list in order */        while (get_next_ngram(id,&br)) {      fprintf(fp,"%.4f ",ng->probs[i][br.pos[i]-1]);      for (j=0;j<=i;j++)	fprintf(fp,"%s ",ng->vocab[id[j]]);      if (i <= ng->n-2)	fprintf(fp,"/t%.4f/n",ng->bo_weight[i][br.pos[i]-1]);      else	fprintf(fp,"/n");    }  }		  fprintf(fp,"/n//end///n");  fclose(fp);	  DeleteArray(words);} 
开发者ID:QuinnEbert,项目名称:zedom8or,代码行数:61,


示例22: main

int main() {    int m=10,n=100;    char** a;    a=CreateArray(n,m);    RandomFill (a,n,m);    PrintArray (a,n,m);    DeleteArray(a,n);    return 0;}
开发者ID:nickolayser,项目名称:lessons,代码行数:12,


示例23: tr

void CDialogSkinAuto::LoadSkel(){	const string skel = QFileDialog::getOpenFileName(this, tr("Charger un squelette"),		"Model/", tr("Fichier squelette (*.chr)"));	if (!skel.isEmpty())	{		QFileInfo fileInfo(skel);		ModelMng->SetModelPath(fileInfo.path() % '/');		CSkeleton* skl = ModelMng->GetSkeleton(fileInfo.fileName());		if (skl)		{			Delete(m_mesh->m_skeleton);			m_mesh->m_skeleton = skl;			DeleteArray(m_mesh->m_bones);			ui.bonesList->clear();			m_items.clear();			ui.skelName->setText(fileInfo.fileName());			m_mesh->m_bones = new D3DXMATRIX[skl->GetBoneCount() * 2];			m_mesh->m_invBones = m_mesh->m_bones + skl->GetBoneCount();			skl->ResetBones(m_mesh->m_bones, m_mesh->m_invBones);			QList<QTreeWidgetItem*> items;			QTreeWidgetItem* item;			Bone* bone;			for (int i = 0; i < skl->GetBoneCount(); i++)			{				bone = &skl->m_bones[i];				item = new QTreeWidgetItem(QStringList(bone->name));				item->setFlags(item->flags() | Qt::ItemIsUserCheckable);				item->setCheckState(0, Qt::Unchecked);				item->setData(0, Qt::UserRole + 1, QVariant(i));				m_items[i] = item;				if (bone->parentID == -1)					items.append(item);				else					m_items[bone->parentID]->addChild(item);			}			ui.bonesList->insertTopLevelItems(0, items);			ui.bonesList->expandAll();			ui.okSkel->setEnabled(true);		}	}}
开发者ID:ServerGame,项目名称:ATools,代码行数:51,


示例24: NewStrLessAnd

GSubMenu::GSubMenu(const char *name, bool Popup){	if (name)	{		char *Temp = NewStrLessAnd(name);		if (Temp)		{			Info = new BMenu(Temp);			DeleteArray(Temp);		}	}	Parent = 0;	Menu = 0;	Window = 0;}
开发者ID:FEI17N,项目名称:Lgi,代码行数:16,


示例25: RunCommand

int RunCommand (struct data * d){	int status = COMMAND_OK;	struct comand * c;	c = d->l->c;	d->l->c = NULL;	status = ProcessInternalCommand (d, c);	if (c != NULL)	{		if (c->in != NULL)			free (c->in);		if (c->out != NULL)			free (c->out);		DeleteArray (c->argv);		free (c);	}	return status;}
开发者ID:abashkirtsev,项目名称:Shell,代码行数:18,


示例26: Delete

CWorld::~CWorld(){	int i, j;	for (i = 0; i < m_continents.GetSize(); i++)		Delete(m_continents[i]);	for (i = 0; i < MAX_OBJTYPE; i++)		for (j = 0; j < m_objects[i].GetSize(); j++)			Delete(m_objects[i].GetAt(j));	if (m_lands)	{		for (i = 0; i < m_width * m_height; i++)			Delete(m_lands[i]);		DeleteArray(m_lands);	}	for (auto it = m_paths.begin(); it != m_paths.end(); it++)		Delete(it.value());	Delete(m_skybox);}
开发者ID:Aishiro,项目名称:ATools,代码行数:18,



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


C++ DeleteCriticalSection函数代码示例
C++ DeleteAllItems函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。