home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 9
/
FreshFishVol9-CD2.bin
/
bbs
/
gnu
/
libnix-0.8-src.lha
/
libnix-0.8
/
sources
/
nix
/
stdio
/
gets.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1994-12-12
|
218 b
|
18 lines
#include <stdio.h>
char *gets(char *s)
{
int c;
char *s2=s;
for(;;)
{ c=fgetc(stdin);
if(ferror(stdin))
return NULL;
if(c==EOF||c=='\n')
break;
*s2++=c;
}
*s2++='\0';
return s;
}