Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ Number(3X) — DeltaWindows 1.3.3 Release 4 Version 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

 

NAME

XtNumber − determine the number of elements in a fixed-size array. 

SYNOPSIS

Cardinal XtNumber(array)

Inputs

arraySpecifies a fixed-size array of arbitrary type. 

Returns

The number of elements in array. 

DESCRIPTION

XtNumber() returns the number of elements in the specified argument list, resource list, or other fixed-size array.  It works only for objects which have been statically initialized or declared with a fixed number of elements, i.e., arrays whose total size is known at compile time. 

USAGE

You should use XtNumber() whenever you are passing a static array to a function or storing an static array in a structure that also expects the number of elements in the array.  This way, if you change the number of element in the array, the correct number of elements will automatically be compiled in. 

BACKGROUND

XtNumber() is a macro defined as follows: #define XtNumber(arr)  ((Cardinal) (sizeof(arr) / sizeof(arr[0])))

SEE ALSO

XtOffsetUNIX SYSTEM V/68, XtOffsetOfUNIX SYSTEM V/68, XtSetArgUNIX SYSTEM V/68. 
 

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