xref: /original-bsd/lib/libc/stdlib/calloc.3 (revision c3e32dec)
1.\" Copyright (c) 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the American National Standards Committee X3, on Information
6.\" Processing Systems.
7.\"
8.\" %sccs.include.redist.man%
9.\"
10.\"	@(#)calloc.3	8.1 (Berkeley) 06/04/93
11.\"
12.Dd
13.Dt CALLOC 3
14.Os
15.Sh NAME
16.Nm calloc
17.Nd allocate clean memory (zero initialized space)
18.Sh SYNOPSIS
19.Fd #include <stdlib.h>
20.Ft void *
21.Fn calloc "size_t nmemb" "size_t size"
22.Sh DESCRIPTION
23The
24.Fn calloc
25function allocates space for an array of
26.Fa nmemb
27objects, each of whose size is
28.Fa size .
29The space is initialized to all bits zero.
30.Sh RETURN VALUES
31The
32.Fn calloc
33function returns
34a pointer to the
35the allocated space if successful; otherwise a null pointer is returned.
36.Sh SEE ALSO
37.Xr malloc 3 ,
38.Xr realloc 3 ,
39.Xr free 3 ,
40.Sh STANDARDS
41The
42.Fn calloc
43function conforms to
44.St -ansiC .
45