#include #include struct node{ struct node *prevPtr; int data; struct node *nextPtr; }; int printList(struct node head){ int i; struct node *tempPtr= malloc(sizeof(struct node)); tempPtr->prevPtr= NULL; tempPtr->data= NULL; tempPtr->nextPtr= NULL; tempPtr->data= head->data; tempPtr->nextPtr= head->nextPtr; for(i=0;;++i){ if(tempPtr->data!=NULL) printf("%d",tempPtr->data); else {printf("Bitti");break;} tempPtr->data= tempPtr->nextPtr->data; tempPtr->nextPtr= tempPtr->nextPtr->nextPtr; } } int main() { struct node *head= malloc(sizeof(struct node)); head->prevPtr=NULL; head->data=0; head->nextPtr=NULL; struct node *body_1= malloc(sizeof(struct node)); head->nextPtr=body_1; body_1->prevPtr=head; body_1->data=1; body_1->nextPtr=NULL; struct node *body_2= malloc(sizeof(struct node)); body_1->nextPtr=body_2; body_2->prevPtr=body_1; body_2->data=2; body_2->nextPtr=NULL; struct node *body_3= malloc(sizeof(struct node)); body_2->nextPtr=body_3; body_3->prevPtr=body_2; body_3->data=3; body_3->nextPtr=NULL; struct node *body_4= malloc(sizeof(struct node)); body_3->nextPtr=body_4; body_4->prevPtr=body_3; body_4->data=4; body_4->nextPtr=NULL; printList(*head); return 0; }