Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- typedef struct datei{
- int wert;
- struct datei *prev;
- struct datei *next;
- }DATEI;
- DATEI *mom=0,*help=0,*first=0,*last=0;
- void erzeugeDatei (int w);
- int main(void){
- erzeugeDatei(1);
- erzeugeDatei(2);
- //erzeugeDatei(3);
- getch();
- }
- void erzeugeDatei(int w){
- if(first==0){
- mom=(DATEI *)malloc(sizeof(DATEI));
- first=mom;
- last=mom;
- mom->prev=0;
- mom->next=0;
- help=mom;
- }
- if(first==mom){
- mom=(DATEI *)malloc(sizeof(DATEI));
- help->next=mom;
- mom->prev=help;
- mom->next=0;
- last=mom;
- help=mom;
- }
- else{
- DATEI *temp;
- mom=(DATEI *)malloc(sizeof(DATEI));
- temp=help->next;
- help->next=mom;
- mom->prev=help;
- mom->next=temp;
- temp->prev=mom;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement