Expand|Select|Wrap|Line Numbers
- #include<stdio.h>
- #include<stdlib.h>
- struct Node
- {
- int data;
- struct Node *add;
- };
- void insert(struct Node **,int );
- void main()
- {
- int pos,value;
- struct Node* head=NULL; struct Node *point;
- insert(&head,10);
- insert(&head,20);
- insert(&head,30);
- insert(&head,40);
- insert(&head,50);
- insert(&head,60);
- insert(&head,70);
- insert(&head,80);
- insert(&head,90);
- insert(&head,100);
- printf("Enter the position from the last to be displayed:");
- scanf("%d",&pos);
- point=display_nth(head);
- value=point->data;
- printf("\n%dth value for nth node is %d",pos,value);
- display(head);
- }
- insert(struct Node** ref_head,int new_data)
- {
- struct Node* temp=(struct Node*)malloc(sizeof(struct Node));
- temp->data=new_data;
- temp->add=(*ref_head);
- (*ref_head)=temp;
- }
8 6 C:\Users\GARIMA\Documents\nth from last.c [Note] previous declaration of 'insert' was here
C:\Users\GARIMA\AppData\Local\Temp\ccqujr3n.o nth from last.c:(.text+0x116): undefined reference to `display'
C:\Users\GARIMA\Documents\collect2.exe [Error] ld returned 1 exit status