struct vg { int cry; int cop; int count; struct vg *next; }; void append(struct vg **q,int cry, int cop) { struct vg *temp,*r; temp = *q; if(*q==NULL) { temp = (struct vg *)malloc(sizeof(struct vg)); temp->cry=cry; temp->cop=cop; temp->count = 0; temp->next=NULL; *q=temp; } else { temp = *q; while(temp->next !=NULL) { temp=temp->next; } r = (struct vg *)malloc(sizeof(struct vg)); r->cry=cry; r->cop = cop; r->count = 0; r->next=NULL; temp->next=r; } } boolean is_exist(struct vg **q,int cry, int cop) { boolean result = false; struct vg *temp=NULL,*r; temp = *q; if(*q==NULL) { result = true; } else { while(temp!=NULL) { n = (struct node *)malloc(sizeof(struct node)); if(temp->cry == cry && temp->cop == cop) { result = true; } else { result = false; } temp = temp->next; } } } void main() { int cry=0,cop=0; struct vg *p; p=NULL; printf(" Enter the Crystal and coupler number"); scanf("%d %d",&cry, &cop); printf("\n"); if(!is_exist(&p,cry,cop)) append(&p,cry,cop); if(can_send_info(&p,cry,cop)) { printf(" Data sent to couplers"); } else { printf(" Data NOT sent to couplers"); } } compilation fails ???
Reveal answer
Fill a bubble to check yourself
Keep practicing — related questions
- struct vg { int cry; int cop; int count; struct vg *next; }; void append(struct vg **q,int cry, int cop) { ...
- struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main(){ struct aaa abc,def,ghi,jkl; int x=100; ab...
- Determine Output : struct node { int a; int b; int c; }; int main() { struct node s= { 3, 5,6 }; struct nod...
- void main() { struct { int EmpNo; } var; var.EmpNo=193149; printf("EmpNo: %d",var.EmpNo); }
- struct io { int i=0; int j; }; void main() { io op; op.j=20; printf("i = %d",op.i); printf("j= %d",op.j); }
- void main() { struct { int EmpNo; } var; var.EmpNo=193149; printf("EmpNo: %d",var.EmpNo); }
- The following C function takes a simply-linked list as input argument. It modifies the list by moving the l...
- A link list contains following items: The first item in link list is A, second is B, third is C, fourth is ...