Calls getch.c to get an operator or an operand,
put into the string s, which is supplied from the main program.
#include <stdio.h>
#include <ctype.h>
#include "getch.h"
#define NUMBER '\007'
int getop(char s[]) {
int i, c;
while ((s[0] = c = getch()) == ' ' || c == '\t');
s[1] = '\0';
if (!isdigit(c) && c != '.')
return c;
i = 0;
if (isdigit(c))
while (isdigit(s[++i] = c = getch()));
if (c == '.')
while (isdigit(s[++i] = c = getch()));
s[i] = '\0';
if (c != EOF)
ungetch(c);
return NUMBER;
}