0
/*what is the error here where I called reverse function*/
/*what is the error here where I called reverse function*/ #include<stdio.h> void reverse(struct node); struct node{ int data; struct node *link; }; struct node *p,*p1,*p2,*p3,*head,*temp,*new; void main() { p=(struct node *)malloc(sizeof(struct node)); p1=(struct node *)malloc(sizeof(struct node)); p2=(struct node *)malloc(sizeof(struct node)); p3=(struct node *)malloc(sizeof(struct node)); p->data=1;p1->data=2;p2->data=3;p3->data=4; head=p; p->link=p1; p1->link=p2; p2->link=p3; p3->link='\0'; temp=head; new=reverse(temp); } void reverse(*struct node temp) { if(temp->next) return; reverse(temp); printf("%d ",temp->data); }
1 Resposta
+ 3
Few minor issues
https://code.sololearn.com/cmoFet8GyIKB