summaryrefslogtreecommitdiffstats
path: root/4
diff options
context:
space:
mode:
authorSadeep Madurange <smadurange@users.noreply.github.com>2021-12-20 19:17:16 +0800
committerSadeep Madurange <smadurange@users.noreply.github.com>2021-12-20 19:17:16 +0800
commit4eaf8f943b1cfe68364c3334d09c61ae0d42e41e (patch)
treeeae82a10ae429c0bf1ee04606718a0950241f058 /4
parentbd08da4ad0bda5b17cca0f657895303516b55597 (diff)
downloadk&r-exercises-4eaf8f943b1cfe68364c3334d09c61ae0d42e41e.tar.gz
4.11
Diffstat (limited to '4')
-rw-r--r--4/11.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/4/11.c b/4/11.c
index bf224c7..54bafcf 100644
--- a/4/11.c
+++ b/4/11.c
@@ -6,6 +6,7 @@
#define MAXOP 100
#define HEIGHT 1000
+#define BUFSIZE 100
#define NUM '0'
#define FUN '1'
@@ -118,6 +119,11 @@ int main(int argc, char *argv[]) {
return 0;
}
+int bufp = 0;
+char buf[BUFSIZE];
+
+int getch() { return (bufp > 0) ? buf[--bufp] : getchar(); }
+
int sp = 0;
double stack[HEIGHT];