s_gets函数中为什么要用ret_val而不直接用st,他们指向的不是一个位置吗
char * s_gets( char * st, int n ) //是函数,但是返回的是地址指针
{
char * ret_val;
int i = 0;
ret_val = fgets(st,n,stdin);
if ( ret_val ) //即返回值不等于NULL,因为NULL的编码是0
{
while ( st[i] != '\n' && st[i] )
i++;
if ( st[i] == '\n' )
st[i] = '\0';
else
while ( getchar() != '\n' )
continue;
}
return ret_val;
}