Skip to content

Commit 7730dc5

Browse files
authored
Merge pull request #65 from sadeem-albir/patch-4
Update variables.c
2 parents ab4be25 + 9b5b51d commit 7730dc5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

chapter_4/exercise_4_06/variables.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ int getop(char s[])
244244

245245
s[1] = '\0';
246246

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

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

0 commit comments

Comments
 (0)