Commits

sunqiang committed 2a6797c

renamve getline

  • Participants
  • Parent commits 4b5271d

Comments (0)

Files changed (2)

File ch01/09/02.ex1.16/getline.c

 #include <stdio.h>
 
 /* getline: read a line into s, return length */
-int getline(char s[], int lim)
+int mygetline(char s[], int lim)
 {
     int c, i;
 

File ch01/09/02.ex1.16/main.c

 
 #define MAXLINE 40  // maximum input line size, 40 is small, test only
 
-int getline(char line[], int maxline);
+int mygetline(char line[], int maxline);
 void copy(char to[], char from[]);
 
 /* print longest input line */
     int len;  // current line length
     char line[MAXLINE];  // current input line
 
-    while ((len = getline(line, MAXLINE)) > 0)
+    while ((len = mygetline(line, MAXLINE)) > 0)
         printf("%2d: %s", len, line);
 
     return 0;