Skip to content

Conversation

@Suraj-Patro
Copy link
Contributor

@Suraj-Patro Suraj-Patro commented Oct 30, 2020

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

  • Added description of change
  • Added tests and example, test must pass
  • Relevant documentation/comments is changed or added
  • Added file name matches File name guidelines
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

when passed with a key of the node.
*/
#include <stdio.h>
#include <stdlib.h>
Copy link
Contributor Author

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: ");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improve sourcecode formatting

Comment on lines 58 to +72
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");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improve sourcecode formatting

Comment on lines +82 to +85
printf("\n1. Add value at first location");
printf("\n2. Delete value from first location");
printf("\n3. View value");
printf("\nEnter your choice: ");
Copy link
Contributor Author

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");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improve sourcecode formatting

@Suraj-Patro Suraj-Patro changed the title Bug fixed Added stdlib.h at singly_link_list_deletion.c Bug fixed; Added stdlib.h at data_structures/linked_list/singly_link_list_deletion.c Oct 31, 2020
@Suraj-Patro Suraj-Patro changed the title Bug fixed; Added stdlib.h at data_structures/linked_list/singly_link_list_deletion.c fix: Fixed error relating importing of Header file <stdlib.h> at data_structures/linked_list/singly_link_list_deletion.c Oct 31, 2020
@Suraj-Patro Suraj-Patro closed this Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant