Skip to content

Commit 9117030

Browse files
committed
changed func getline to get_line so we don't conflict with the stdio function
1 parent 424c085 commit 9117030

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Ch1_Tutorial_Introduction/print_longest_line.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#define MAXLINE 1000 //maximum input line size
44

5-
int getline( char line[], int maxline );
5+
int get_line( char line[], int maxline );
66
void copy( char to[], char from[] );
77

88
//print longest input line
@@ -14,7 +14,7 @@ int main()
1414
char line[MAXLINE]; //current input line
1515
char longest[MAXLINE]; //longest input line we know about
1616

17-
while ((len = getline(line, MAXLINE)) > 0){ //get the line
17+
while ((len = get_line(line, MAXLINE)) > 0){ //get the line
1818
if (len > max){ //if the length is longer than the previous
1919
max = len; //longest, copy it to `longest` and save the length
2020
copy(longest,line);
@@ -27,7 +27,7 @@ int main()
2727
}
2828

2929
// read a line in to s, return the length
30-
int getline(char s[], int lim){
30+
int get_line(char s[], int lim){
3131
int c,i;
3232

3333
for (i = 0;

0 commit comments

Comments
 (0)