Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- typedef struct data
- {
- int a;
- struct data *next;
- } data;
- data *head=NULL;
- //Inser At First
- void fst(int x)
- {
- data *new =(data*)malloc(sizeof(data));
- new->a=x;
- new->next=NULL;
- if(head==NULL)
- {
- head=new;
- return;
- }
- new->next=head;
- head=new;
- }
- int main()
- {
- fst(4);
- fst(13);
- fst(8);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement