List* List_UnsafeInsertAtIndex(List* list, int index, void* value) { Node* node = list->first; for (int i = 0; i < index; i++) { node = node->next; } Node_Insert(node->prev, value); list->count++; return list; }
void COptionTreeItemRadio::InsertNewRadio(CString strText, BOOL bChecked) { // Uncheck all if (bChecked == TRUE) { Node_UnCheckAll(); } // Insert new node Node_Insert(strText, bChecked); // Recalculate height ReCalculateHeight(); }
Node *Load_File(char *Filename) { FILE * fp = fopen(Filename, "r"); //open file to read if (fp == NULL) { return NULL; //file not opened case } Node * head = NULL; long val; //individual values while (fscanf(fp, "%ld", &val) == 1) //read reading an integer from file { head = Node_Insert(head, val); //insert the value read from the file into the linked list at the rear end and also increment size } fclose(fp); //close file pointer return head; //return the linked list pointed to by head }