xref: /csrg-svn/lib/libc/stdlib/calloc.3 (revision 50286)
148914Scael.\" Copyright (c) 1991 The Regents of the University of California.
248914Scael.\" All rights reserved.
348914Scael.\"
4*50286Sbostic.\" This code is derived from software contributed to Berkeley by
5*50286Sbostic.\" the American National Standards Committee X3, on Information
6*50286Sbostic.\" Processing Systems.
7*50286Sbostic.\"
848914Scael.\" %sccs.include.redist.man%
948914Scael.\"
10*50286Sbostic.\"	@(#)calloc.3	5.2 (Berkeley) 06/29/91
1148914Scael.\"
1248914Scael.Dd
1348914Scael.Dt CALLOC 3
1448914Scael.Os
1548914Scael.Sh NAME
1648914Scael.Nm calloc
1748914Scael.Nd allocate clean memory (zero initialized space)
1848914Scael.Sh SYNOPSIS
1948914Scael.Fd #include <stdlib.h>
2048914Scael.Ft void *
2148914Scael.Fn calloc "size_t nmemb" "size_t size"
2248914Scael.Sh DESCRIPTION
2348914ScaelThe
2448914Scael.Fn calloc
2548914Scaelfunction allocates space for an array of
2648914Scael.Fa nmemb
2748914Scaelobjects, each of whose size is
2848914Scael.Fa size .
2948914ScaelThe space is initialized to all bits zero.
3048914Scael.Sh RETURN VALUES
3148914ScaelThe
3248914Scael.Fn calloc
3348914Scaelfunction returns
3448914Scaela pointer to the
3548914Scaelthe allocated space if successful; otherwise a null pointer is returned.
3648914Scael.Sh SEE ALSO
3748914Scael.Xr malloc 3 ,
3848914Scael.Xr realloc 3 ,
3948914Scael.Xr free 3 ,
4048914Scael.Sh STANDARDS
4148914ScaelThe
4248914Scael.Fn calloc
4348914Scaelfunction conforms to
4448914Scael.St -ansiC .
45