Item

ArraySetNInt

Put a 64-bit integer into an array element

Syntax

Signature
int ArraySetNInt( ITEM *array, size_t index, int64_t value );

Arguments

array Array to access.

index Element position, counted from 1.

value Signed 64-bit integer to store.

Return value

1; 0 outside the array. The index counts from 1.

Description

Replaces the slot with an IT_INTEGER value. Use ArrayGetNInt() to read values that exceed the range of int.

Example

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

#include <inttypes.h>
#include <stdio.h>

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

   if( !array )
      return 1;

   ArraySetNInt( array, 1, INT64_C( 5000000000 ) );
   printf( "%" PRId64 "\n", ArrayGetNInt( array, 1 ) );
   ItemRelease( array );

   return 0;
}