Originally Posted by
BEN10
the getline() function takes a line with as much as 999 characters in it and the condition is that as oon as u press EOF the line will be finished and also if '\n' is pressed the line will be changed and the last character of the lin ewill be '\n'.
so in getline function s[i] = c it cr8tes the string but this check
Code:
if
(
c == '\n') {s[i] = c;
++i;
} why did he do this coz a string doesnt contain \n ?also in main
Code:
while ((len = getline(line, MAXLINE)) > 0)
i thought EOF is -1 not bigger than zero ?