I want to convert an integer value to string in GLib. Is there any macro or function to da that? Or Can i store different data types in the same doubly linked list?
The easiest way to convert int to String is very simple. Just add to int or Integer an empty string "" and you'll get your int as a String. It happens because adding int and String gives you a new String. That means if you have int x = 5 , just define x + "" and you'll get your new String.
In Python an integer can be converted into a string using the built-in str() function. The str() function takes in any python data type and converts it into a string.
gchar *my_string = g_strdup_printf("%i", my_integer);
GINT_TO_POINTER
, but how will you know what data type to get back out?If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With