Item

ItemArrayNew

Allocate a new one-dimensional ITEM array

Syntax

Signature
ITEM *ItemArrayNew( size_t length );

Arguments

length is the number of slots to allocate.

Return value

A new caller-owned array containing NIL slots.

Description

Use ItemRelease() to free the array and the values it owns. Element positions begin at 1.

Example

itemarraynew.c
#include "xdev-wtui.h"

#include <stdio.h>

int main( void )
{
   ITEM *array = ItemArrayNew( 2 );

   ArraySetC( array, 1, "Open" );
   puts( ArrayGetCPtr( array, 1 ) );
   ItemRelease( array );

   return 0;
}

Output

Open

See also