Item

ItemPutND

Store a double in an ITEM

Syntax

Signature
ITEM *ItemPutND( ITEM *item, double value );

Arguments

item is an existing ITEM to replace. Pass NULL to allocate a new ITEM.

value is the double to store.

Return value

The destination ITEM, or a new caller-owned ITEM when item is NULL.

Description

Sets the type to IT_DOUBLE. Read it with ItemGetND(). Release a newly allocated ITEM with ItemRelease().

Example

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

#include <stdio.h>

int main( void )
{
   ITEM *item = ItemPutND( NULL, 12.5 );

   printf( "%.1f\n", ItemGetND( item ) );
   ItemRelease( item );

   return 0;
}

Output

12.5

See also