Re: XForms: what function needed?

Steve Lamont (spl@szechuan.ucsd.edu)
Sat, 2 Jan 99 09:21:04 PST

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> > quotes. Another idea was to check for a function that scans the string
> > and returns the ASCII numbers of the respective char the pointer
> > currently points to; but....what's the name of such a function. - I was
> > looking at atoi/strtol etc...
>
> int strlen(char *string);

That returns the number of characters, exclusive of the '\0'
terminator, in a string.

The ASCII character is simply returned by dereferencing the pointer:

int x;
char *string;

[...]

x = *string;

sets `x' to whatever is in the byte pointed to by `*string'. Thus if
`*string' points to "ABC", `x' would be the ASCII value of 'A' or 0x41
(65 in decimal).

C isn't like Pascal or BASIC, where you need special functions to
convert between character and integer values.

Of course, with the advent of wide (16 bit) characters some of this
becomes a bit more problematic. The `widec' manual page discusses
this at greater length than I can profitably go into here, since to my
knowledge XForms does not support this at present.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/