RE: string to guint conversion /w GTK+ 2



There isn't an existing function to do this. You'll need to write it, which
you may have already realized.

Use the strtok function to tokenize the string (i.e. separate the numbers
from the commas). You call this function iteratively until you get to the
end of the string. Each time you call the function, it will return a pointer
to a character string that will contain one of the numbers. You can then use
a function like atoi (or a glib equivalent if there is one) to convert the
string to an integer. You can then put this integer intoa GArray.

David

> -----Original Message-----
> From: gtk-list-admin gnome org [mailto:gtk-list-admin gnome org]On
> Behalf Of Vladimir Djokic
> Sent: Sunday, June 09, 2002 6:52 PM
> To: gtk-list gnome org
> Subject: string to guint conversion /w GTK+ 2
>
>
> hi,
> maybe this isn't the mailin list in wich i  should ask for help, but...
>
> i'm, for my final school project, making an application for
> serbian schools:
>
> student data, grades, reports...
>
> i need a function that will take a string of number separated by ','
> ('1,2,3,23,456,5,6') and translate this string into *guint* numbers so i
> can add them to *GArray*.
>
> p.s. i'm using GTK+ 2.0.0.
>
> THANKS! :)
>
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list




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