📄 subject_58810.htm
字号:
<p>
序号:58810 发表者:lvjzh*** 发表日期:2003-11-04 12:16:21
<br>主题:memset函数
<br>内容:void *memset( void *dest, int c, size_t count );<BR><BR>如题此函数的用法及作用,请指教
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:xiongli 回复日期:2003-11-04 12:20:53
<br>内容:从dest地址开始填写c,一直填写count个c<BR>以byte为单位<BR><BR><BR>memset<BR>Sets buffers to a specified character.<BR><BR>void *memset( void *dest, int c, size_t count );<BR><BR>Routine Required Header Compatibility <BR>memset <memory.h> or <string.h> ANSI, Win 95, Win NT <BR><BR><BR>For additional compatibility information, see Compatibility in the Introduction.<BR><BR>Libraries<BR><BR>LIBC.LIB Single thread static library, retail version <BR>LIBCMT.LIB Multithread static library, retail version <BR>MSVCRT.LIB Import library for MSVCRT.DLL, retail version <BR><BR><BR>Return Value<BR><BR>memset returns the value of dest.<BR><BR>Parameters<BR><BR>dest<BR><BR>Pointer to destination<BR><BR>c<BR><BR>Character to set<BR><BR>count<BR><BR>Number of characters<BR><BR>Remarks<BR><BR>The memset function sets the first count bytes of dest to the character c.<BR><BR>Example<BR><BR>/* MEMSET.C: This program uses memset to<BR> * set the first four bytes of buffer to "*".<BR> */<BR><BR>#include <memory.h><BR>#include <stdio.h><BR><BR>void main( void )<BR>{<BR> char buffer[] = "This is a test of the memset function";<BR><BR> printf( "Before: %s\n", buffer );<BR> memset( buffer, '*', 4 );<BR> printf( "After: %s\n", buffer );<BR>}<BR><BR><BR>Output<BR><BR>Before: This is a test of the memset function<BR>After: **** is a test of the memset function<BR><BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:lvjzh*** 回复日期:2003-11-04 13:18:34
<br>内容:我看过MSDN了,可本人的english不是很好:),所以请告诉我memset是干什么用的?简单点就行,谢谢!<BR>2003-11-4 15:49:19
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -