Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct _stack {
- char* data;
- int capacity;
- int size;
- }* Stack;
- typedef struct Element
- {
- struct Element *prev;
- Stack sir;
- struct Element *next;
- }Element;
- typedef struct Element* Lista;
- Lista addLast(Lista l, Stack val)
- {
- Lista nou, temp;
- if (l==NULL)
- {
- l->prev = NULL;
- l->sir = val;
- l->next = NULL;
- }
- else
- {
- nou=(Element *)malloc(sizeof(Element));
- temp=l;
- while(temp->next!=NULL)
- temp=temp->next;
- nou->sir=val;
- nou->next=NULL;
- nou->prev=temp;
- temp->next=nou;
- }
- return l;
- }
Advertisement
Add Comment
Please, Sign In to add comment