用getchar 和 putchar 实现的gets 和puts 大家看看有什么问题
char *mygets(char *butter){
int i = 0;
char c;
c = getchar();
while(c != '\n' && c != EOF)
{
*(butter + i) = c;
i ++;
c = getchar();
}
*(butter + i) = '\0';
return butter;
}
int myputs(char *butter)
{
int i = 1;
char c;
c = *butter;
while(c != '\0')
{
putchar(c);
c = *(butter + i);
i ++;
}
putchar('\n');
return i - 2;
}