Re: Best way to copy a GString object

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

 



Hi,

Michael Torrie <torriem@xxxxxxxxxxxx> writes:

> What is the best way to copy a GString object in glib (plain c)?  There
> doesn't seem to be any copy constructor.  My current guess is to use
> g_string_new_len(src->str,src-len).  However that won't put in a
> terminating null character which I'd like to have so it will be easier
> to manipulate this string later.

Read the docs again or, even better, take a look at the source.
g_string_new_len() will of course NULL-terminate the string for you.


Sven
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux