-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix: Fixed error relating importing of Header file <stdlib.h> at data_structures/linked_list/singly_link_list_deletion.c #766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| when passed with a key of the node. | ||
| */ | ||
| #include <stdio.h> | ||
| #include <stdlib.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added stdlib.h for dynamic memory allocation
| struct node *p; | ||
| p = createnode(); | ||
| printf("\nenter the number to insert"); | ||
| printf("\nEnter the number to insert: "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve sourcecode formatting
| struct node *p; | ||
| if (start == NULL) | ||
| { | ||
| printf("\nlist is empty"); | ||
| printf("\nList is empty.\n"); | ||
| } | ||
| else | ||
| { | ||
| p = start; | ||
| printf("\n"); | ||
| while (p != NULL) | ||
| { | ||
| printf("%d ", p->info); | ||
| p = p->link; | ||
| } | ||
| printf("\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve sourcecode formatting
| printf("\n1. Add value at first location"); | ||
| printf("\n2. Delete value from first location"); | ||
| printf("\n3. View value"); | ||
| printf("\nEnter your choice: "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve sourcecode formatting
| break; | ||
| default: | ||
| printf("\ninvalid choice"); | ||
| printf("\ninvalid choice.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve sourcecode formatting
Description of Change
Bug fixed by adding stdlib.h at singly_link_list_deletion.c
Needed for dynamic memory allocation
Improved source code formatting
References
Checklist
Notes: