Example #1
0
File: dict.c Project: hhktony/dict
int main(int argc, char *argv[])
{
	pnode_t phead = NULL;
	int choice = 0;

	phead = create_link();

#ifndef __NDEBUG__
	print_link(phead);
#endif

	while (1)
	{
#ifdef __NDEBUG__
        system("clear");
#endif
		choice = menu();
		if (choice == SEARCH_WORD)
			search_for_word(phead);
		else if (choice == ADD_WORD)
			phead = add_word(phead);
		else if (choice == EXIT_DICT)
			break;
	}

	free_link(phead);

	return 0;
}
Example #2
0
int main(void)
{
	int choice;
	V_NODE *head = NULL;

	head = create_link();
	while(1)
	{
		choice = menu();
		if(choice == 1)
		{
			search_for_word(head);
		}
		else if(choice == 2)
		{
			head = add_word(head);
		}
		else if(choice == 9)
		{
			break;
		}
	}
	return 0;
}