Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- typedef struct node
- {
- int a;
- char ch;
- struct node *next;
- }node;
- int main()
- {
- node *N=(node*)malloc(sizeof(node));
- scanf("%d", &N->a);
- scanf(" %c", &N->ch);
- N->next=NULL;
- node *p=(node*)malloc(sizeof(node));
- scanf("%d", &p->a);
- scanf(" %c", &p->ch);
- p->next=NULL;
- N->next=p;
- printf("N:a:%d\n", N->a);
- printf("N:ch:%c\n", N->ch);
- printf("\np:a:%d\n", p->a);
- printf("p:ch:%c\n", p->ch);
- //printf("\np:a:%d\n", N->next->a);
- //printf("p:ch:%c\n", N->next->ch);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement