学K&R的C程序设计语言第一章的这个程序就卡住了解决思路

学K&R的C程序设计语言第一章的这个程序就卡住了
1.9字符数组,例子是要求输出最长的文本行


#include<stdio.h>
#define MAXLINE 1000

int getline(char line[] , int maxline );
void copy(char to[] ,char from[]);

main ()
{
int len ;
int max;
char line[MAXLINE];
char longest[MAXLINE];

max = 0 ;

/*  len=getline(line,MAXLINE);   测试程序,getline函数没问题,copy不输出字符
printf("%d\t",len);
copy(longest,line);
len=getline(longest,MAXLINE);
printf("%d",len);   */

while ((len = getline(line, MAXLINE)) > 0)
if (len > max){
max =len ;
copy(longest, line);
}
if (max > 0)
printf("%s",longest);
return 0;
}
int getline(char s[],int lim)
{
int c , i ;
for (i = 0 ; i< lim-1 && (c=getchar())!=EOF && c!='\n';++i)
s[i] = c ;
if (c =='\n')
{
s[i] = c ;
++i ;
}
s[i] = '\0';
return i ;
}                 


void copy(char to[] , char from[])   
{
int i;
i=0;
while((to[i] = from[i]) != '\0')
 ++i;

}




copy是main函数的调用函数,没用到指针应该不能修改longest[ ]啊。。
小白一个,求助,c语言吧难民
------解决思路----------------------
程序没有错误啊
你的问题需要理解这段话
A function may change the values of its parameters, but these changes cannot affect the values of the
arguments.  On the other hand, it is possible to pass a pointer to an object, and the function may
change the value of the object pointed to. A parameter declared to have array or function type is
adjusted to have a pointer type
 as described in 6.9.1.
以及参考C99的6.7.5.3条款