您的位置:首页 > 其它

memset;wmemset(源自msdn)

2014-09-13 10:49 337 查看
以下源自msdn:----------------------------------------------------------------------------------------------

void *memset(

   void *dest,

   int c,

   size_t count

);

wchar_t *wmemset(

   wchar_t *dest,

   wchar_t c,

   size_t count

);

参数:-------------------------------------------------------------------------------------------------------------

dest  :Pointer to destination.c       :Character to set.count:Number of characters.说明:-------------------------------------------------------------------------------------------------------------Sets the first count characters of
dest to the character c. (置dest的前count个值为c)依赖头文件:----------------------------------------------------------------------------------------------------memset

 <memory.h> or <string.h>

wmemset

 <wchar.h>例子:-------------------------------------------------------------------------------------------------------------  #include <memory.h>  #include <stdio.h>

 

  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 );

  }输出:-------------------------------------------------------------------------------------------------------------Before: This is a test of the memset function

After:  **** is a test of the memset function

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  memset