Skip to content

Commit 30fc6c5

Browse files
authored
Update stack.c
modified the clear function
1 parent f989204 commit 30fc6c5

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

chapter_4/exercise_4_04/stack.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,6 @@ void swap(void)
158158

159159
void clear(void)
160160
{
161-
/* do
162-
{
163-
stack[sp] = 0.0;
164-
} while (sp--);
165-
*/
166-
// Replacing the above commented code with this one ensures messages of "stack empty" aren't displayed an extra time after c command is called in the program
167161
while (sp > 0)
168162
{
169163
stack[--sp] = 0.0;

0 commit comments

Comments
 (0)