Re: gchar-char-GString



author <millward Ms UManitoba CA> writes:

Is there a simple way to avoid having to constantly
cast between GTK types and POSIX/ANSI data types?
If you want to use POSIX/ANSI  C functions you have
to use the proper data types, but GTK has its own
proprietory data types.  Then there's GTK's string
manipulator functions which uses GString data type
which doesn't agree with any GTK functions I've seen yet.
Constantly casting!
Can anyone tell me how to get around this data type problem?

Leave out the casts? We have:

 typedef int gint;
 typedef char gchar;
 typedef double gdouble;

And this will _always_ be the case. The GLib types are 
only aliases for the standard names (some people like
the consistency with guint, gint32, etc.)

[ Note that thiws doesn't apply to GString, which is not
  just a char *. To get a char * out of a GString, use
  g_string->str ]

Regards,
                                        Owen




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