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; +}