1 /* 1-18. Write a program to remove trailing blanks and tabs from each
2 * line of input, and to delete entirely blank lines.
5 /* MAXLINE has been reduced for easier testing */
9 int getlin(char line[], int maxline);
10 void copy(char to[], char from[]);
14 int len; /* current line length */
15 char line[MAXLINE]; /* current input line */
17 while ((len = getlin(line, MAXLINE)) > 0) {
24 int getlin(char s[], int lim)
29 for (i=0; i<lim-1 && (c=getchar())!=EOF && c!='\n'; ++i) {
30 if (c != '\t' && c != ' ') {
41 void copy(char to[], char from[])
45 while ((to[i] = from[i]) != '\0')