Re: reading from a string

Steve Lamont (spl@szechuan.ucsd.edu)
Sun, 16 Feb 97 12:30:33 PST

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

> [...]
> I presume this returns a pointer to the first element in the string.
> Therefore successive incrementation should produce the next in the string.
> But I get the value of the next letter in the alphabet....
> [...]
> char *plain;
> char store[100];
> int x=0;
>
> void plaintext_cb(FL_OBJECT *ob, long data)
> {
> *plain = *fl_get_input(ob);

This should be:

plain = fl_get_input(ob);

What you're doing is dereferencing the pointer returned by
fl_get_input(), which is, of course, the first character in the
string, and assigning it to whatever 'plain' points to.

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/xforms-archive/