Re: convert from alpha to int



Hi,

I don't know if Glib has functions to perform such a check, but standard C does:
http://www.cplusplus.com/reference/clibrary/cctype/

If you know that the string's digital value cannot be 0, then you can also check a non-null return to atoi or atol (in cstdlib).

yann

On 18/03/12 20:49, Arbol One wrote:
Thank you for your prompt response.

I am sorry, I don't think I explained myself well enough. If the user
enters the number 24 in an Gtk::Entry, how can I check if the entry is
actually a number and not a character string?

thank in advance

*From:*Kjell Ahlstedt [mailto:kjell ahlstedt bredband net]
*Sent:* Thursday, March 15, 2012 11:12 AM
*To:* Arbol One
*Cc:* gtkmm-list gnome org
*Subject:* Re: convert from alpha to int

2012-03-15 13:53, Arbol One skrev:

Does Glibmm provide a way to convert an character value to an integer value?

TIA

Don't know exactly what type of conversion you want. If you want to
convert a utf-8 encoded character to the character's Unicode code point,
Glib contains the g_utf8_to_ucs4() function. I don't think it's wrapped
in a Glibmm function.

You can find a lot of similar functions at
http://developer.gnome.org/glib/stable/glib-Unicode-Manipulation.html.

Kjell



_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]