⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_58810.htm

📁 vc
💻 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 &lt;memory.h&gt; or &lt;string.h&gt; 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 &#34;*&#34;.<BR> */<BR><BR>#include &lt;memory.h&gt;<BR>#include &lt;stdio.h&gt;<BR><BR>void main( void )<BR>{<BR>&nbsp;&nbsp; char buffer[] = &#34;This is a test of the memset function&#34;;<BR><BR>&nbsp;&nbsp; printf( &#34;Before: %s\n&#34;, buffer );<BR>&nbsp;&nbsp; memset( buffer, '*', 4 );<BR>&nbsp;&nbsp; printf( &#34;After:&nbsp;&nbsp;%s\n&#34;, buffer );<BR>}<BR><BR><BR>Output<BR><BR>Before: This is a test of the memset function<BR>After:&nbsp;&nbsp;**** 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 + -