Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtCalloc(3) — OSF1 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtErrorMsg(1)

XtFree(1)

XtMalloc(1)

XtNew(1)

XtNewString(1)

XtRealloc(1)

 

Name

XtCalloc — allocate an array and initialize elements to zero. 

Synopsis

char ∗XtCalloc(num, size);

  unsigned int num;
  unsigned int size;

Arguments

numSpecifies the number of array elements to allocate. 

sizeSpecifies the size of an array element in bytes. 

Description

XtCalloc allocates space for the specified number of array elements of the specified size and initializes the space to zero.  If there is insufficient memory to allocate the new block, XtCalloc terminates by calling XtErrorMsg. 

XtCalloc differs from XtMalloc in that it stores zero in all the array elements. 

The function XtCalloc is implemented by the Toolkit independently of the particular environment, so programs ported to a system not supporting calloc will still work. 

XtNew and XtNewString provide slightly higher-level approaches to memory allocation. 

See Also

XtErrorMsg(1), XtFree(1), XtMalloc(1), XtNew(1), XtNewString(1), XtRealloc(1). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026