From 9e9944633825c71d8cc14cc8f0e21e9cf7399803 Mon Sep 17 00:00:00 2001 From: DebMendes77 Date: Mon, 21 Oct 2019 19:09:05 +0530 Subject: [PATCH] accepted data using tmp->data instead of another variable --- C/doubly_Linked_List.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/C/doubly_Linked_List.c b/C/doubly_Linked_List.c index 2f508b9..49f0aac 100644 --- a/C/doubly_Linked_List.c +++ b/C/doubly_Linked_List.c @@ -98,15 +98,14 @@ void traverseNode() void beginNode() { - node *tmp; int val; + node *tmp; tmp = (node*)malloc(sizeof(node)); printf("Enter the Value:"); - scanf("%d", &val); + scanf("%d", &tmp->data); tmp->next = tmp->prev = NULL; - tmp->data = val; if(head == NULL && tail == NULL) head = tail = tmp;