Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- struct node{
- int x;
- char y;
- struct node*p ;
- };
- struct node*ptr,*head,*first;
- int main(){
- int i,k=1;
- char l='a';
- head=ptr;
- ptr=(struct node*)malloc(sizeof(struct node));
- for(i=0;i<26;i++){
- ptr->x=k++;
- ptr->y=l++;
- printf("%d %c\n",ptr->x,ptr->y);
- ptr->p=(struct node*)malloc(sizeof(struct node));
- ptr= ptr->p;
- }
- ptr->p=NULL;
- ptr=head;
- first=(struct node*)malloc(sizeof(struct node));
- first->x=27;
- first->y='A';
- first->p=ptr;
- head=first;
- printf("%d %c\n",ptr->x,ptr->y);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement