Home > Back-end >  Warning: when using a pointer P warned warning the assignment from incompatible pointer type | airli
Warning: when using a pointer P warned warning the assignment from incompatible pointer type | airli

Time:09-28

The airline * modefy_airline (airline * l, char * air_num)
{
The airline * p;
P=l -> next;
for(; p!=NULL; P=p -> next)
{
If (STRCMP (air_num, p -> air_num)==0)
{
P -> left++;
Return the l;
}
Printf (" NO, the airline ");
return 0;
}}
Int insert_air (airline * * p, char * air_num, char * plane_num, char * end_place, int total, int left, int price)
{
The airline * q;
Q=(airline *) malloc (sizeof (airline));
Strcpy (q -> air_num, air_num);
Strcpy (q -> plane_num plane_num);
Strcpy (q -> end_place end_place);
Q -> total=total;
Q -> left=left;
Q -> price=price;
Q -> next=NULL;
(* p) -> next=q;
(* p)=(* p) -> next;
return OK;
}
Int the book (the airline * a, char * air_num, customer * c, char * name, char * id_num)
{
The airline * p=a;
The customer * q=c -> next;
P=a -> next;
for(; Q -> next!=NULL!=NULL; Q=q -> next)
for(; P -> next!=NULL; P=p -> next)
{
If (p -> left> 0)
{
Printf (" your seat number is % d ", (p -> total - p -> left + 1));
Insert_cus (& q, name, air_num, id_num, p -> total - p -> left + 1);
P -> left -;
return OK;
}
The else
{
Printf (" seat is full ");
return 0;
}
}
}
Int search_air (airline * head)
{
The airline * p=head -> next;
Printf (" air_num plane_num end_place total left price \ n ");
for(; p!=NULL; P=p -> next)
{
Printf (" % s % % % - 10 s to 8 s - 8-8-8 d % d % d \ n ", p -> air_num, p -> plane_num, p -> end_place, p -> total, p -> left, p -> price);
}
return OK;
}
  • Related