diff options
Diffstat (limited to 'ch4/4-10_getline-calc.c')
-rw-r--r-- | ch4/4-10_getline-calc.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/ch4/4-10_getline-calc.c b/ch4/4-10_getline-calc.c index 499e71a..a801f0c 100644 --- a/ch4/4-10_getline-calc.c +++ b/ch4/4-10_getline-calc.c @@ -63,7 +63,6 @@ int main() { double op2; char s[MAXOP]; char ltr; - while (mygetline(buf, BUFSIZE) != 0) { bufp = 0; while ((type = getop(s)) != '\0') { @@ -188,7 +187,6 @@ double pop(void) { int getop(char s[]) { int i, c; - while ((s[0] = c = buf[bufp++]) == ' ' || c == '\t'); if (c >= 'a' && c <= 'z') { return c; @@ -210,7 +208,6 @@ int getop(char s[]) { } else { s[i] = c; } - if (isdigit(c)) { while (isdigit(s[++i] = c = buf[bufp++])); } @@ -264,7 +261,6 @@ double fetch_last(void) { int mygetline(char s[], int lim) { int c, i = 0; - while (--lim > 0 && (c = getchar()) != EOF && c != '\n') { s[i++] = c; } |