Partager via


memset, wmemset (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference

Sets buffers to a specified character.

void*memset(   void*dest,    intc,    size_tcount);whar_t *wmemset(    wchar_t*dest,   wchar_tc,    size_tcount);

Parameters

  • dest
    Pointer to destination.
  • c
    Character to set.
  • count
    Number of characters.

Return Values

memset and wmemset return the value of dest.

Remarks

The memset and wmemset functions set the first count characters of dest to the character c.

Example

/* MEMSET.C: This program uses memset to
 * set the first four characters of buffer to "*".
 */

#include <memory.h>
#include <stdio.h>

void main( void )
{
   char buffer[] = "This is a test of the memset function";

   printf( "Before: %s\n", buffer );
   memset( buffer, '*', 4 );
   printf( "After:  %s\n", buffer );
}

Output

Before: This is a test of the memset function
After:  **** is a test of the memset function

Requirements

OS Versions: Windows CE 2.0 and later.
Header: stdlib.h.
Link Library: coredll.dll.

See Also

Commit-to-Disk Constants | fflush | _flushall

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.