From 82ef6e9888d27c4ef4964fc08cf7be6e525999e9 Mon Sep 17 00:00:00 2001 From: celso Date: Wed, 9 Nov 2022 06:59:58 -0300 Subject: [PATCH] seventeenth exercise - not sure about this one --- 1-17.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 1-17.c diff --git a/1-17.c b/1-17.c new file mode 100644 index 0000000..824a9eb --- /dev/null +++ b/1-17.c @@ -0,0 +1,37 @@ +#include +#define MAXLINE 1000 /* maximum input line length */ + +/* ggetline: read a line into 'line', return length */ +int ggetline(char line[], int maxline){ + int c, i; + for (i=0; (c=getchar()) != EOF && c!='\n'; i++){ + if(i0){ + copy(longline, line); + printf("%s\n", longline); + } + return 0; +}