[gtkmm] Glib::ustring -> int



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)?




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