RE: string to guint conversion /w GTK+ 2

El lun, 10-06-2002 a las 08:39, David L. Cooper II escribió:
> 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.

strtok is unsafe and is unrecommended,  use g_strsplit instead.

gchar**     g_strsplit                      (const gchar *string,
                                             const gchar *delimiter,
                                             gint max_tokens);

German Poo Caaman~o
mailto:gpoo ubiobio cl

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