home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_10_10
/
1010020a
< prev
next >
Wrap
Text File
|
1992-08-12
|
306b
|
17 lines
Listing 8 -- the file memset.c
/* memset function */
#include <string.h>
void *(memset)(void *s, int c, size_t n)
{ /* store c throughout unsigned char s[n] */
const unsigned char uc = c;
unsigned char *su = (unsigned char *)s;
for (; 0 < n; ++su, --n)
*su = uc;
return (s);
}