home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Microsoft Programmer's Library 1.3
/
Microsoft-Programers-Library-v1.3.iso
/
sampcode
/
prof_c
/
util
/
lines.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
C/C++ Source or Header
|
1988-08-11
|
306 b
|
22 lines
/*
* lines -- send newlines to the output stream
*/
#include <stdio.h>
#include <stdlib.h>
int
lines(n, fp)
int n;
FILE *fp;
{
register int i;
for (i = 0; i < n; ++i)
if (putc('\n', fp) == EOF && ferror(fp))
break;
/* return number of newlines emitted */
return (i);
}