Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include "lista.h"
- struct elemento *inserimento(char str[20],int n )
- {
- struct elemento *p,*aus;
- int i;
- p=(struct elemento *)malloc(sizeof(struct elemento));
- p->inf=str[0];
- printf("%c",p->inf);
- aus=p;
- aus=aus->next;
- aus=(struct elemento *)malloc(sizeof(struct elemento));
- for(i=0;i<n;i++)
- {
- aus->inf=*str++;
- aus->next=(struct elemento *)malloc(sizeof(struct elemento));
- aus=aus->next;
- }
- return p;
- }
- void stampa(struct elemento *p)
- {
- while(p!=NULL)
- {
- printf("%c --> ",p->inf);
- p=p->next;
- }
- printf("NULL");
- }
Add Comment
Please, Sign In to add comment