Q:

Getting a number from an entry text

I am making an interface using GTK and C. I've put an entry text in my interface, the user will type only numbers. And I need to get the entered numbers to use them later. However, using the function gtk_entry_get_text will stock the entered text in a const gchar variable. How can I get what the user typed as a number?
The code to get the text is: 
static void ok_clicked(GtkWidget *widget, GtkWidget *entry){ 
const gchar *get_text; 
get_text = gtk_entry_get_text(GTK_ENTRY(entry)); 
printf("entry contents: %s\n",get_text); }

A:

You could use guint64 g_ascii_strtoll (const gchar *nptr,gchar **endptr,guint base);
which converts a string to a gint64 value. This function behaves like the standard strtoll() function does in the C locale. For double you could use
gdouble g_ascii_strtod (const gchar *nptr, gchar **endptr); I hope this helps. 

