Skip to content

Commit

Permalink
Update stack.c
Browse files Browse the repository at this point in the history
Removed the last else-block from the "if (c == '-')" to prevent second digit from being skipped in the parsing process.
  • Loading branch information
sadeem-albir authored Feb 27, 2024
1 parent 8229054 commit 976ab8a
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions chapter_4/exercise_4_04/stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,6 @@ int getop(char s[])
s[++i] = c = next;
}
}
// else
// {
// c = getch();
// }
// This else block caused '33 44+' to output 7 instead of 77

if (isdigit(c))
{
Expand Down

0 comments on commit 976ab8a

Please sign in to comment.