setmem
Remonter à Mem.h - Index
Header File
mem.h
Category
Memory and String Manipulation Routines
Prototype
void setmem(void *dest, unsigned length, char value);
Description
Assigns a value to a range of memory.
setmem sets a block of length bytes, pointed to by dest, to the byte value.
Return Value
None.
Example
#include <stdio.h>
#include <alloc.h>
#include <mem.h>
int main(void)
{
char *dest;
dest = (char *) calloc(21, sizeof(char));
setmem(dest, 20, 'c');
printf("%s\n", dest);
return 0;
}
Portability
POSIX | Win32 | ANSI C | ANSI C++ |
---|---|---|---|
+ |