[10];
pos->farther = new char [20];
pos->faculty = new char [20];
do {
fscanf(handle,"%i %s %s %s %s %s %s %d %d %d\n",&sPtr->ind,sPtr->surname,sPtr->name,sPtr->farther,
sPtr->faculty,sPtr->group,sPtr->form,&sPtr->year,&sPtr->mark,&sPtr->for_delete);
sPtr->next = NULL;
}while(sPtr->for_delete == 1);
pos = sPtr;
do {
student *pv;
pv = new student;
pv->for_delete = 0;
pv->surname = new char [20];
pv->form = new char [6];
pv->group = new char [7];
pv->name = new char [10];
pv->farther = new char [20];
pv->faculty = new char [20];
fscanf(handle,"%i %s %s %s %s %s %s %d %d %d\n",&pv->ind,pv->surname,pv->name,pv->farther,
pv->faculty,pv->group,pv->form,&pv->year,&pv->mark,&pv->for_delete);
pv->next = NULL;
if (pv->for_delete == 0) {
pos->next = pv;
pos = pv; }
else delete pv;
}while(!feof(handle));
return sPtr;}
//---------------------------------------------------------------------------------
int get_index(){
int index = 0;
FILE* handle;
if ((handle = fopen("stud.dat","r")) == NULL) {
return 1; }
fseek(handle,0,0);
char ch;
fscanf(handle,"%d",&index);
do {
ch = fgetc(handle);
if (ch == '\n') fscanf(handle,"%d",&index);
}while(!feof(handle));
fclose(handle);
++index;
return index;}
//---------------------------------------------------------------------------------
void complete(int index){
FILE* handle;
if ((handle = fopen("stud.dat","a+")) == NULL) {
printf("Error opening file.\n");
getch();
exit(1); }
fseek(handle,0,0);
student *people;
people = new student;
people->ind = index;
people->for_delete = 0;
people->surname = new char [20];
people->form = new char [6];
people->group = new char [7];
people->name = new char [10];
people->farther = new char [20];
people->faculty = new char [20];
people->next = NULL;
clrscr();
printf("Enter name, surname and farther\n");
cin>>people->surname>>people->name>>people->farther;
printf("Show faculty (Informaciunuu, Prurodnuchuu or Ekonomichnuu) and group:\n");
cin>>people->faculty>>people->group;
printf("Enter form of study, year and mark:\n");
cin>>people->form>>people->year>>people->mark;
int size;
fprintf(handle,"%d %s %s %s %s %s %s %d %d %d\n",people->ind,people->surname,people->name,people->farther,
people->faculty,people->group,people->form,people->year,people->mark,people->for_delete);
fclose(handle);
delete people;}
ДОДАТОК B
Блок-схема функції main()
ТАК
НІ
ТАК
НІ
ТАК
НІ
ТАК
НІ
ТАК НІ
Блок-схема функції get_index()
Блок-схема функції complete()
Блок-схема функції deleting ()
Блок-схема функції forming()
ТАК
НІ
ТАК
НІ
ТАК
НІ
НІ
Блок-схема функції revival()
Блок-схема функції Ldelete()
ТАК
НІ
Блок-схема функції form()
ТАК НІ
ТАК
НІ
НІ ТАК
ТАК