]> zdv2.bktei.com Git - BK-2023-05.git/blob - src/kr_exercises/ch1/s1.9/count.c
feat(src/kr/ch1/s1.1/p6):Add hello world example
[BK-2023-05.git] / src / kr_exercises / ch1 / s1.9 / count.c
1 #include <stdio.h>
2 #define MAXLINE 1000
3
4 /* Exercise 1-17. Write a program to print all input lines that are
5 longer than 80 characters. */
6
7 int get_line(char line[], int maxline);
8
9 int main() {
10 printf("DEBUG:Begin main().\n");
11 char line[MAXLINE];
12
13
14 get_line(MAX_LENGTH);
15 return 0;
16 };
17
18 int get_line(int max) {
19 int c;
20 printf("DEBUG:Begin get_line().\n");
21 printf("DEBUG:max:%d.\n", max);
22 while(int i = 0; i < max-1 && (c = getchar()) != EOF && c != '\n'; ++i) {
23
24 }
25
26 return 0;
27 }