Создание базы данных по составлению синонимического словаря, страница 4

                                    printf("Какой по счету элемент удалить? ");

                                    scanf("%d", &n);

                                    Sin *pCur = (Sin*)  pSins->GetHead();

                                    for (int i = 0; i < n-1; i++)

                                    {

                                         if (pCur)

                                               pCur = (Sin*) pCur->GetNext();

                                    }

                                    pCur->RemoveItem();

                                    printf("\n!Данный элемент удален");

                                    break;

                              }

                        }

                        break;

            }

            case 4:

            {

                  pSlovos->DeleteLIST();

                  printf("\nВсе элементы удалены!!!\n");

                  break;

            }

            case 0:exit;

      }

      }while(r!=0);

}

void Display()

{

        int p=0;

        printf("\nЧто выводить на экран?\n1 - Только слова\n2 - Только синонимы\n3 - Все вместе");

        scanf("%d",&p);

        switch(p)

        {

            case 1:

            {

            Slovo *c= (Slovo*) pSlovos->GetHead();

               int i = 0;

            for(;c; c=(Slovo*)c->GetNext())

            {

            printf("\n***%d***\nслово: %s",++i, c->GetWord());

            printf("\nПервый перевод: %s", c->GetTrans1());

            printf("\nВторой перевод: %s",c->GetTrans2());

            printf("\nЧасть речи: %s", c->GetPart());

            }

            getchar();

            getchar();

            break;

            }

            case 2:

            {

            Sin *m=(Sin*) pSins->GetHead();

               int i = 0;

            for(;m; m=(Sin*)m->GetNext())

            {

                  printf("\n|--%d--|\nВведите синоним: %s",++i,m->GetSword());

                  printf("\nВведите первый перевод:%s ",m->GetTrans1());

                  printf("\nВведите второй перевод:%s",m->GetTrans2());

                  printf("\nВведите часть речи: %s",m->GetPart());

                  printf("\nВведите иные сведения:  %s",m->Getother());

            }

            getchar();

            getchar();

            break;

            }

            case 3:

            {

                  Link *pTmp= new Link;

            printf("|# |                    слово|             синоним|Дата перевода|\n");

            printf("|--+------------------------------+------------------------------+-----------|\n");

            int i=0;

            pTmp=(Link*)pLink->GetHead();

            for(;pTmp;pTmp=(Link*)pTmp->GetNext())

            printf("|%2d|%30s|%30s|%11s|\n",++i,pTmp->GetSlovo()->GetWord(),

                                                pTmp->GetSin()->GetSword(),

                                                pTmp->GetHours());

            getchar();

            break;

            }

        }

}

LIST* LIST::GetLast()

{

      LIST *pElement=this;

      while(pElement->_pNext)

      pElement=pElement->_pNext;

            return pElement;

}

int LIST::SaveToFile(FILE* fp)

{

      if(!fp)

            return 0;

      return fwrite(&_nId,sizeof(_nId),1,fp);

}

int LIST::LoadFromFile(FILE* fp)

{

      if(!fp)

            return 0;

      return fread(&_nId,sizeof(_nId),1,fp);

}

int Slovo::SaveToFile(FILE* fp)

{

      if(!LIST::SaveToFile(fp))

                        return 0;

      if(!FileHelper::WriteString(fp,Word))

                        return 0;

      if(!FileHelper::WriteString(fp,Trans1))

                        return 0;

      if(!FileHelper::WriteString(fp,Trans2))

                        return 0;

      if(!FileHelper::WriteString(fp,Part))

                        return 0;

      return 1;

}

int Slovo::LoadFromFile(FILE* fp)

{

      if(!LIST::LoadFromFile(fp))

                        return 0;

      if(!FileHelper::ReadString(fp,Word))

                        return 0;

      if(!FileHelper::ReadString(fp,Trans1))

                        return 0;

      if(!FileHelper::ReadString(fp,Trans2))

                        return 0;

      if(!FileHelper::ReadString(fp,Part))

                        return 0;

      return 1;

}

int Sin::SaveToFile(FILE* fp)

{

      if(!LIST::SaveToFile(fp))

                        return 0;

      if(!FileHelper::WriteString(fp,Sword))

                        return 0;

      if(!FileHelper::WriteString(fp,Trans1))

                        return 0;

      if(!FileHelper::WriteString(fp,Trans2))

                        return 0;

      if(!FileHelper::WriteString(fp,Part))

                        return 0;

      if(!FileHelper::WriteString(fp,other))

                        return 0;

      return 1;

}

int Sin::LoadFromFile(FILE* fp)

{

      if(!LIST::LoadFromFile(fp))

                        return 0;

      if(!FileHelper::ReadString(fp,Sword))

                        return 0;

      if(!FileHelper::ReadString(fp,Trans1))

                        return 0;

      if(!FileHelper::ReadString(fp,Trans2))

                        return 0;

      if(!FileHelper::ReadString(fp,Part))

                        return 0;

      if(!FileHelper::ReadString(fp,other))

                        return 0;