MEMSET, WMEMSET RUN-TIME LIBRARY REFERENCE

xiaoxiao2021-03-06  82

Run-Time Library Reference

Memset, WMemset

See Also

Buffer manipulation routines | _MEMCCPY | MEMCHR | MEMCMP | MEMCPY | _STRNSET | Run-Time Routines and .NET Framework Equivalents

Requirements

RoutineRequidHeaderCompaTibilityMemset or Ansi, Win 98, Win Me, Win NT, Win 2000, Win XPWMemSet ANSI, WIN 98, WIN ME, WIN NT, WIN 2000, WIN XP

For Additional Compatibility Information, See Compatibility In The Introduction.

Libraries

All Versions of The C Run-Time Libraries.

Sets buffers to a specified character.

Void * MEMSET

Void * DEST,

INT C,

SIZE_T Count

);

WCHAR_T * WMEMSET

Wchar_t * dest,

Wchar_t C,

SIZE_T Count

);

Parameters

Destin

Pointer to Destination.

c

CHARACTER TO SET.

count

NUMBER OF CHARACTERS.

Return Value

The value of dest.

Remarks

Sets the first count chars of dest to the character c.

Security Note Make Sure That The Destination Buffer Is The Same Size Or Larger Than The Source Buffer. For more information, see

Avoiding Buffer Overruns

.

Requirements

RoutineRequidHeaderCompaTibilityMemset or Ansi, Win 98, Win Me, Win NT, Win 2000, Win XPWMemSet ANSI, WIN 98, WIN ME, WIN NT, WIN 2000, WIN XP

For Additional Compatibility Information, See Compatibility In The Introduction.

Libraries

All Versions of The C Run-Time Libraries.

EXAMPLE

// CRT_MEMSET.C

/ * This Program Uses Memset To

* Set The First Four Chars of Buffer to "*".

* /

#include

#include

Int 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

See Also

Buffer manipulation routines | _MEMCCPY | MEMCHR | MEMCMP | MEMCPY | _STRNSET | Run-Time Routines and .NET Framework Equivalents

Send Feedback on this Topic to Microsoft

© Microsoft Corporation. All Rights Reserved.

转载请注明原文地址:https://www.9cbs.com/read-107103.html

New Post(0)