字符串函数 - memset

原型:extern void *memset(void *buffer, int c, int count);

用法:#include <string.h>

功能:把buffer所指内存区域的前count个字节设置成字符c。

说明:返回指向buffer的指针。

举例:



      // memset.c
      
      #include <syslib.h>
      #include <string.h>

      main()
      {
        char *s="Golden Global View";
        
        clrscr();
        
        memset(s,'G',6);
        printf("%s",s);

        getchar();
        return 0;
      }
      
  
相关函数:bzero,setmem,strset