void MainWin::delword() { int row = ui.result->currentIndex().row(); if (row < 0) return; delWord(findres[row].word); saveDict(); gotranslate(); }
int main(int argc, char * argv[]) { dict_t* head = NULL; dict_t* head2 = NULL; dict_t* pDict = NULL; char ch = '\0'; //readFile(argv[1], &head); //readFile("x.dat", &head); readTxtFile("dict.txt", &head); readTxtFile("dict2.txt", &head2); pDict = head; while(pDict) { print_node(pDict); printf("\n"); pDict = pDict->next; } while(1) { printf("take a choice:\n1 add a new word\n2 delete a word\n3 search a word\n4 reverse to search a word\nx exit\n"); scanf("%c", &ch); switch(ch) { case '1': addWord(&head); break; case '2': delWord(&head); break; case '3': searchWord(&head); break; case '4': reverseSearchWord(&head); break; case 'x': printf("exit...\n"); return 0; break; default: continue; break; } } //writeFile("x.dat", &head); return 0; }