本文整理汇总了C++中deleteList函数的典型用法代码示例。如果您正苦于以下问题:C++ deleteList函数的具体用法?C++ deleteList怎么用?C++ deleteList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deleteList函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
double *getNewValues(double *x, int n, list *blocks, double *y)
{
int i=0, j;
list *node = blocks;
while(i<n)
{
if(node != NULL && checkBoundires(node, i))
{
for(j=i;j<=node->blockEndIndex;j++)
y[j] = node->avg;
i = node->blockEndIndex+1;
node = node->next;
}
else
{
y[i] = x[i];
i++;
}
}
deleteList(blocks);
return y;
}
示例2: deleteList
static void deleteList(ListNode * l)
{
if(! l -> next)
delete l;
deleteList(l -> next);
delete l;
}
示例3: main
int main() {
linknode *flist,*rlist,*find;
int index; char value;
rlist=(linknode*)malloc(sizeof(linknode));
rlist->next=NULL;
printf("plase input a sting,end with the KEY_Enter \n");
//flist=CreateListF();
//printLinkList(flist);
CreateListR(rlist);
printLinkList(rlist);
printf("list length=%d \n",getLength(rlist));
printf("set insert node:index,value:");
scanf("%d,%c",&index,&value);
printf("insert a element!");
insertList(rlist,value,index);
printLinkList(rlist);
printf("list length=%d \n",getLength(rlist));
printf("set delete node index:");
scanf("%d",&index);
deleteList(rlist,index);
printf("delete a element!");
printLinkList(rlist);
printf("list length=%d \n",getLength(rlist));
printf("set visit node index:");
scanf("%d",&index);
find=getNode(rlist,index);
if(find!=NULL)
{
printf("this node value=%c \n",find->data);
}
return 0;
}
示例4: IODTFindMatchingEntries
void AppleMacIO::publishBelow( IORegistryEntry * root )
{
OSCollectionIterator * kids;
IORegistryEntry * next;
IOService * nub;
// infanticide
kids = IODTFindMatchingEntries( root, kIODTRecursive, deleteList() );
if( kids) {
while( (next = (IORegistryEntry *)kids->getNextObject())) {
next->detachAll( gIODTPlane);
}
kids->release();
}
// publish everything below, minus excludeList
kids = IODTFindMatchingEntries( root, kIODTRecursive | kIODTExclusive,
excludeList());
if( kids) {
while( (next = (IORegistryEntry *)kids->getNextObject())) {
if( 0 == (nub = createNub( next )))
continue;
nub->attach( this );
processNub(nub);
nub->registerService();
}
kids->release();
}
}
示例5: find_specific
//
// tries to make an exit parse var
PARSE_VAR *use_one_parse_token_exit(CHAR_DATA *looker, PARSE_TOKEN *tok,
const char *name) {
int type = FOUND_NONE;
void *found = find_specific(looker, name, "", "", FIND_TYPE_EXIT, tok->scope,
tok->all_ok, &type);
// make sure we found something
if(found == NULL)
return NULL;
else {
PARSE_VAR *var = newParseVar(PARSE_VAR_EXIT);
// if multiple vals were possible, flag it
var->multiple_possible = tok->all_ok;
// Is it a single exit?
if(type == FOUND_EXIT)
var->ptr_val = found;
// or is it multiple exits?
else if(type == FOUND_LIST) {
if(listSize(found) > 1) {
var->ptr_val = found;
var->multiple = TRUE;
}
else if(listSize(found) == 1) {
var->ptr_val = listPop(found);
deleteList(found);
}
else {
deleteList(found);
deleteParseVar(var);
var = NULL;
}
}
// We should never reach this case
else {
deleteParseVar(var);
var = NULL;
}
// return whatever we found
return var;
}
}
示例6: deleteList
/***********************************************************************
* ExchangeWindow
* init
***********************************************************************/
void fired::ExchangeWindow::init(fired::MapObjectCollector *collector) {
deleteList(exchange);
sf::Vector2f winOffset = win->offset;
for (int i = 0; i < 10; i++)
for (int j = 0; j < 5; j++)
exchange.push_back(new fired::InventoryWindowItem(winOffset + sf::Vector2f(380.0f + 35.0f * i, 185.0f + 35.0f * j), &collector->items[i][j], itAny));
}
示例7: deleteList
// This destructor destroys a list and frees the associated nodes.
void deleteList(List l)
{
if (l == 0)
return;
List rest = l->nextPtr;
free(l);
deleteList(rest);
};
示例8: deleteList
void deleteList(struct xTEDSQualifierListNode* p)
{
if(p==NULL) return;
deleteList(p->next);
if(p->data!=NULL)
delete(p->data);
free(p);
}
示例9: deleteList
void deleteList(Node *head)
{
if(!head)
return ;
deleteList(head->next) ;
free(head) ;
}
示例10: _tmain
int _tmain(int argc, _TCHAR* argv[])
{
printf("0 - exit\n");
printf("1 - add value to sorted list\n");
printf("2 - remove value from list\n");
printf("3 - print list\n");
IntList *head = newList(-1);
while(true)
{
printf("Input command:\n");
int command = 0;
scanf("%d", &command);
int val = 0;
switch (command)
{
case 0:
deleteList(head);
return 0;
case 1:
printf("Input value:\n");
scanf("%d", &val);
addToSortedList(head, val);
break;
case 2:
printf("Input value:\n");
scanf("%d", &val);
removeValue(head, val);
break;
case 3:
printList(head);
break;
};
}
deleteList(head);
scanf("%*s");
return 0;
}
示例11: main
int main()
{
constexpr unsigned N = 5;
list listx = nullptr;
createCircularList(listx,N);
printList(listx);
deleteList(listx);
return 0;
}
开发者ID:franciscomunoz,项目名称:Sedgewick-algorithms-in-C-14--exercises-and-examples,代码行数:10,代码来源:ex_3.27.cpp
示例12: deleteList
/* deletes list */
void deleteList(element head,int is_nodes,int recursivly){
if(head==NULL){
return;
}
deleteList(head->next,is_nodes,recursivly);
if (recursivly==1){
remove_tree(head->node,0,recursivly);
}
free(head);
}
示例13: destroyHashTable
void destroyHashTable(hash_t *hashTable) {
// Free all of the lists
for (int i = 0; i < hashTable->capacity; i++) {
if (hashTable->buckets[i] != NULL) {
deleteList(hashTable->buckets[i]);
}
}
free(hashTable->buckets);
free(hashTable);
}
示例14: deleteScriptGenerator
/// Function name : deleteScriptGenerator
// Description : Destroys a ScriptGenerator
//
// SCRIPT_GENERATOR* &ScriptGenerator : [in] ScriptGenerator to destroy
//
VOID deleteScriptGenerator(SCRIPT_GENERATOR* &pGenerator)
{
// Delete Arguments/Variables list
deleteList(pGenerator->pVariablesList);
// Delete XML Tree
if (pGenerator->pXMLTree)
deleteXMLTree(pGenerator->pXMLTree);
// Zero Layout
utilZeroObject(&pGenerator->oLayout, XML_SCRIPT_LAYOUT);
// Delete INPUT and OUTPUT
deleteList(pGenerator->pInputList);
deleteCommandStream(pGenerator->pOutputStream);
// Delete Generator
utilDeleteObject(pGenerator);
}
示例15: deleteList
List& List::operator =(
const List& other) {
if (this != &other) {
deleteList();
copyList(other);
}
return *this;
}