字符串函数bzero

来源:互联网 发布:pkpm脚手架计算软件 编辑:程序博客网 时间:2024/05/16 11:06
原型:extern void bzero(void *s, int n);

  用法:#include <string.h>
 
  功能:置字节字符串s的前n个字节为零。
 
  说明:bzero无返回值。
 
  举例:

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

      main()
      {
        struct
        {
          int a;
          char s[5];
          float f;
        } tt;
       
        char s[20];
       
        bzero(&tt,sizeof(tt));  // struct initialization to zero
        bzero(s,20);
       
        clrscr();
        printf("Initail Success");

        getchar();
        return 0;
      }
     
  相关函数:bcmp,bcopy
(摘自 http://www.ggv.com.cn/forum/clib/string/strstr.html)