Skip to content

Commit

Permalink
Merge pull request #65 from sadeem-albir/patch-4
Browse files Browse the repository at this point in the history
Update variables.c
  • Loading branch information
ohkimur authored Mar 5, 2024
2 parents ab4be25 + 9b5b51d commit 7730dc5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions chapter_4/exercise_4_06/variables.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ int getop(char s[])

s[1] = '\0';

if (isalpha(c) && !(c >= 'A' && c <= 'Z'))
if (islower(c))
{
var = c;
return VARGET;
Expand Down Expand Up @@ -296,7 +296,3 @@ int getop(char s[])

return NUMBER;
}
/* To prevent the variable checking in getop() from overlapping with the letter commands,
make sure you set the commands to capital letters and explicitly tell the getop() to only
check for variable-getting if the character is not capital
e.g insteat of "if (isalpha(c))" you add "if (isalpha(c) && !(c >= 'A' && c >= 'Z'))"*/

0 comments on commit 7730dc5

Please sign in to comment.