ITEM find_node ITEM head ITEM cur char int col if head NULL list retur

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ITEM* find_node(ITEM *head)
{
ITEM *cur;
char *n;
int col=1;
if(head==NULL)
{
list();
return head;
}
window(1,2,80,25);
clrscr();
textbackground(CYAN);
textcolor(BLUE);
clrscr();
gotoxy(2,2);
cprintf("\n Животное: ");
scanf("%s",n);
cur=head;
while(cur!=NULL)
{
if(strcmp(cur->data->animal,n)==0)
{
window(1,2,80,25);
textbackground(GREEN);
textcolor(WHITE);
clrscr();
gotoxy(32,2);
cprintf("Элемент найден\n");
gotoxy(28,4);
cprintf(" %s %s %s %d %d",cur->data->animal,cur->data->clas,cur->data->food,&cur->data->dayfood,&cur->data->number);
//return head;
}
col++;
cur=cur->next;
}
window(1,1,80,25);
textbackground(YELLOW);
textcolor(RED);
clrscr();
gotoxy(31,2);
cprintf("Элемент не найден:(\n");
return head;
}