home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Microsoft Programmer's Library 1.3
/
Microsoft-Programers-Library-v1.3.iso
/
sampcode
/
prof_c
/
util
/
spaces.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
|
312 b
|
22 lines
/*
* spaces -- send spaces (blanks) to the output stream
*/
#include <stdio.h>
#include <stdlib.h>
int
spaces(n, fp)
int n;
FILE *fp;
{
register int i;
for (i = 0; i < n; ++i)
if (putc(' ', fp) == EOF && ferror(fp))
break;
/* return number of spaces emitted */
return (i);
}