Name

bzero - write zero bytes

Library

libc.lib

Synopsis

  #include <strings.h>
  void bzero (void *b, size_t len);

Detailed description

The bzero function writes len zero bytes to the string b. If len is zero, bzero does nothing.

Examples

#include <string.h>
#include <stdio.h>
int main()
{
    char dst[50] = "abcdef";
    bzero(dst + 2, 2);
    if(!strcmp(dst, "ab")) printf("dst =  %s\n",dst);
    if(!strcmp(dst+3, "")) printf("zeros added to dst string\n");
    if(!strcmp(dst + 4, "ef")) printf("dst + 4 = %s\n",dst);
    return 0;
}

         

Output

dst =  ab
zeros added to dst string
dst + 4 = ab

         

See also

memset, swab

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top