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