Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xtnumber(3) [hpux man page]

XtNumber()																XtNumber()

Name
  XtNumber - 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.

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  com-
  pile 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 auto-
  matically be compiled in.

Background
  XtNumber() is a macro defined as follows:

     #define XtNumber(arr)  ((Cardinal) (sizeof(arr) / sizeof(arr[0])))

See Also
  XtOffset(1), XtOffsetOf(1), XtSetArg(1).

Xt - Argument Lists															XtNumber()

Check Out this Related Man Page

XtOffset(3)							   XT FUNCTIONS 						       XtOffset(3)

NAME
XtOffset, XtOffsetOf, XtNumber - determine the byte offset or number of array elements SYNTAX
Cardinal XtOffset(Type pointer_type, Field field_name); Cardinal XtOffsetOf(Type structure_type, Field field_name); Cardinal XtNumber(ArrayVariable array); ARGUMENTS
array Specifies a fixed-size array. field_name Specifies the name of the field for which to calculate the byte offset. pointer_type Specifies a type that is declared as a pointer to the structure. structure_type Specifies a type that is declared as a structure. DESCRIPTION
The XtOffset macro is usually used to determine the offset of various resource fields from the beginning of a widget and can be used at compile time in static initializations. The XtOffsetOf macro expands to a constant expression that gives the offset in bytes to the specified structure member from the beginning of the structure. It is normally used to statically initialize resource lists and is more portable than XtOffset, which serves the same function. The XtNumber macro returns the number of elements in the specified argument lists, resources lists, and other counted arrays. SEE ALSO
XtGetResourceList(3), XtSetArg(3) X Toolkit Intrinsics - C Language Interface Xlib - C Language X Interface X Version 11 libXt 1.1.3 XtOffset(3)
Man Page

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need help in resolving Compilation error

state_field state_abvr = { "AL","ALABAMA", "AK","ALASKA", "AZ","ARIZONA", "AR","ARKANSAS", "CA","CALIFORNIA", "CO","COLORADO", "CT","CONNECTICUT", "DE","DELAWARE", "DC","DISTRICT-OF-COLUMBIA", "FL","FLORIDA", "GA","GEORGIA", "HI","HAWAII", "ID","IDAHO", "IL","ILLINOIS",... (1 Reply)
Discussion started by: jagan_kalluri
1 Replies

2. Programming

Compilation error : Please help

state_field state_abvr = { "AL","ALABAMA", "AK","ALASKA", "AZ","ARIZONA", "AR","ARKANSAS", "CA","CALIFORNIA", "CO","COLORADO", "CT","CONNECTICUT", "DE","DELAWARE", "DC","DISTRICT-OF-COLUMBIA", "FL","FLORIDA", "GA","GEORGIA", "HI","HAWAII", "ID","IDAHO", "IL","ILLINOIS",... (1 Reply)
Discussion started by: jagan_kalluri
1 Replies

3. Programming

how to change the default background color for x windows

I am using uil to build the widgets. I compiled the below code using gcc 3.4.6 compiler. Launched x window in light gray color. How to change the default color of the window? #include <X11/Xlib.h> #include <Xm/Xm.h> #include <Mrm/MrmAppl.h> void main ( int argc, char **argv ) {... (1 Reply)
Discussion started by: satish@123
1 Replies

4. UNIX Desktop Questions & Answers

Xaw3d asciiTextWidget: how to scroll right without scrollbar

this is kinda solved Hi I need to program an ordinary text field which scrolls to the right when it gets filled. It must be in Xaw3d. I cannot get the asciiTextWidget to do it. Which resource do you need to set in asciiTextWidget to allow the widget to scroll to the right when typing text... (1 Reply)
Discussion started by: Bibi Monash
1 Replies

5. Shell Programming and Scripting

Mathematical Loop

Hi, I'm creating a loop that allows the user to enter any number, then their choice of operator and then another number until their operator choice is equal to = But I am getting an error saying integer expression expected. Any explanation on why this is happening? echo "Please enter a number"... (1 Reply)
Discussion started by: Addman1991
1 Replies

6. Shell Programming and Scripting

Script to send email if count is >1

i have below code to count number of rows in file1.txt, if the row count is more than one then i have sending an email along with file1.txt attached and fail the process(do nothing if count is <=1), if I test individually count part works good but when i include the email part its not working,... (4 Replies)
Discussion started by: srini_106
4 Replies

7. UNIX for Beginners Questions & Answers

Change text font to greater one in this very good MOTIF texteditor ?

Hi, i have here found a very good texteditor source code programmed in the MOTIF GUI language. For myself i need NOTHING else to program. To start from a very easy point of view i want to RUN this editor on my LINUX machine and type simple C code. The reason for this post is that the text... (7 Replies)
Discussion started by: Sennenmut
7 Replies