2.1.2.35 memset


Description

Set specified number of bytes of a buffer to a specified integer value .

Syntax

LPVOID memset( LPVOID lpMem, int nValue, size_t uSize )

Parameters

lpMem
[modify] Pointer to lpMem
nValue
[input]Integer value to set
uSize
[input]Number of integer value

Return

The value of lpMem.

Examples

EX1

void memset_ex1()
{
    int aa = 0;
    LPVOID nPtr =  memset(&aa, 255, sizeof(int));
    if(nPtr)
    	printf("now aa is %x \n", aa);
    else 
    	printf("memset failed\n");
}

Remark

the input parameter nValue should not be greater than 255

See Also

Header to Include

origin.h

Reference