Курсовая работа: Інформаційно-довідкова система 2
}
}
void output_file(Trist *&a, int n)
{
ofstream file("a.dat",ios::out|ios::binary);
if (!file)
{
cerr << "\nOshibka vivoda v fail!\n";
getch();
exit(1);
}
file.seekp(0);
file.write((char*)&(n),sizeof(n));
a->current=a->head;
while (a->current!=NULL)
{
file.write((char*)&(a->current->t),sizeof(a->current->t));
file.write(a->current->d->nazv,sizeof(a->current->d->nazv));
switch (a->current->t)
{
case 0:
album1 *obj1;
obj1=(album1*)a->current->d;
int trek = obj1->getTrek();
file.write((char*)&(trek),sizeof(trek));
break;
case 1:
album2 *obj2;
obj2=(album2*)a->current->d;