Admin Production ni-theme
Current Publication

calloc

LabWindows/CVI

calloc

void *calloc (size_t numberOfElements, size_t elementSize);

Purpose

Allocates memory space for an array of elements in which an element's size is specified by elementSize and total number of elements is specified by number_ofElements. Thus, the amount of memory allocated is equal to (elementSize*number_ofElements).The allocated memory space is initialized to all zero bits.

Parameters

Input
Name Type Description
numberOfElements size_t Specifies the number of elements for which space is allocated.
elementSize size_t Specifies the size of each element in bytes.

Return Value

Name Type Description
memBlockPointer void * A pointer to the memory block allocated. If the space cannot be allocated or if the size of the space requested is zero, the function returns a null pointer.

Additional Information

Library: ANSI C Library

Include file: ansi_c.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Examples

Refer to the following examples that use the calloc function:

  • apps\uirview\uirview.cws

    Open example
  • toolbox\list.cws

    Open example
  • userint\ICOViewer.cws

    Open example
  • userint\intgraph.cws

    Open example