[PR #303] [CLOSED] Update stack_using_linkedlists.c #621

Closed
opened 2026-01-29 15:14:13 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/TheAlgorithms/C/pull/303
Author: @abhis2007
Created: 10/2/2019
Status: Closed

Base: masterHead: patch-4


📝 Commits (1)

  • 8cf7390 Update stack_using_linkedlists.c

📊 Changes

1 file changed (+28 additions, -30 deletions)

View changed files

📝 data_structures/linked_list/stack_using_linkedlists.c (+28 -30)

📄 Description

If you don't declare function before main as prototype only then also program will execute correctly and number of line can be reduced by defining function and their code at the top of main function.You not need to define function as prototype before main and their definition at below the main function.
And in line number 17 rather than while(x!=4) you should use c inbuilt library function exit()
available in #include<stdlib.h> because you have used this library for malloc function so I think you should exit() function.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/TheAlgorithms/C/pull/303 **Author:** [@abhis2007](https://github.com/abhis2007) **Created:** 10/2/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `patch-4` --- ### 📝 Commits (1) - [`8cf7390`](https://github.com/TheAlgorithms/C/commit/8cf739082caad8e2b31db9e2a42e6ba6929ab452) Update stack_using_linkedlists.c ### 📊 Changes **1 file changed** (+28 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `data_structures/linked_list/stack_using_linkedlists.c` (+28 -30) </details> ### 📄 Description If you don't declare function before main as prototype only then also program will execute correctly and number of line can be reduced by defining function and their code at the top of main function.You not need to define function as prototype before main and their definition at below the main function. And in line number 17 rather than while(x!=4) you should use c inbuilt library function exit() available in #include<stdlib.h> because you have used this library for malloc function so I think you should exit() function. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 15:14:13 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#621