[Previous]
[Contents]
[Next]

memset(), _fmemset()

set the first part of an object to a given value

Synopsis:

#include <string.h>
void *memset( void *dst,
              int c,
              size_t length );
void __far *_fmemset( void __far *dst,
                      int c,
                      size_t length );

Description:

The memset() function fills the first length characters of the object pointed to by dst with the value c.

The _fmemset() function is a data-model-independent form of the memset() function. It accepts far pointer arguments, and returns a far pointer. It is most useful in mixed memory model applications.

Returns:

A pointer to the destination buffer (that is, the value of dst).

Examples:

#include <string.h>

void main()
  {
    char buffer[80];

    memset( buffer, '=', 80 );
  }

Classification:

memset() is ANSI; _fmemset() is WATCOM.
Safety:
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

memchr(), memcmp(), memcpy(), memicmp(), memmove()


[Previous]
[Contents]
[Next]