XtNumber()XtNumber()NameXtNumber - determine the number of elements in a fixed-size array.
Synopsis
Cardinal XtNumber(array)Inputs
array Specifies a fixed-size array of arbitrary type.
Returns
The number of elements in array.
DescriptionXtNumber() 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 num‐
ber of element in the array, the correct number of elements will auto‐
matically be compiled in.
BackgroundXtNumber() is a macro defined as follows:
#define XtNumber(arr) ((Cardinal) (sizeof(arr) / sizeof(arr[0])))
See AlsoXtOffset(1), XtOffsetOf(1), XtSetArg(1).
Xt - Argument Lists XtNumber()