c jes金柱赫:VC++中,有没有现成的函数把一个字符串清零啊?

来源:百度文库 编辑:高校问答 时间:2024/04/30 01:42:16
最近在写一个与网络有关得程序,里面出现了点问题,我想把缓冲区清零,这样的话就比较规范,我用的是VC++6.0,哪位高手能教教我啊?
谢谢啊!

void *memset( void *dest, int c, size_t count );

The memset function sets the first count bytes of dest to the character c.

Reference:MSDN

ANSI c
use in anywhere

ZeroMemory
The ZeroMemory function fills a block of memory with zeros.

VOID ZeroMemory(
PVOID Destination, // memory block
SIZE_T Length // size of memory block
);
Parameters
Destination
[in] Pointer to the starting address of the block of memory to fill with zeros.
Length
[in] Size, in bytes, of the block of memory to fill with zeros.
Return Values
This function has no return value.

Reference:MSDN

用memset函数`