zero(3C)
_________________________________________________________________
zero $builtin function
Fill a section of memory with zeros.
_________________________________________________________________
Calling Sequence
char *ptr;
int size;
char *zero(); (or) $builtin char *zero();
ptr = zero(ptr, size);
where ptr is a byte pointer to the memory location that
you want to fill with zeros.
size is the number of bytes to zero.
Description
Use the zero function to fill in a specified memory area with
zeros. The function will zero out the number of bytes you
specify. Using the $builtin zero function might result in
smaller or faster code, but it will not work for other
implementations of C.
The include file dglib.h declares this function.
Returns
The zero function returns the character pointer, ptr.
Related Functions
See also the bzero and calloc functions.
Example
/* Program test for the zero() function */
char ptr[] = "Zero out this string.";
int size;
char *zero();
main() {
printf("%s\n", ptr);
size = strlen( ptr);
ptr = zero(ptr, size);
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
zero(3C)
printf("'%s' zeroed out.\n", ptr);
}
A call to the program test generates the output
Zero out this string.
rin
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)