Re: [gtkmm] Glib::ustring -> int



Glib::ustring.c_str() returns `const char*' you can use.
It's all in the documentation.

--matjaz

Benjamin A. Cooper wrote:
This may be a dumb question, but I am new to C++ and to gtkmm, as well as GTK+ in general.

I have a Glib::ustring (returned from one of the widgets) I want to convert it to an integer for use elsewhere in my program.

I tried the standard C function "atoi" but it does not work, I get the following error:
cannot convert `Glib::ustring' to `const char*' for argument `
   1' to `long int atol(const char*)'

How do I get an int from the string (and a float as well)?

_______________________________________________
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]