On Thu, Apr 25, 2002 at 11:33:15AM -0400, Ruben I Safir wrote:
> In regards to g_strdup, do I need to allocate the memory for the
> returned string. It's not clear in the documentation. Or do I
> still need to allocate the memory seperately
>From the API reference:
g_strdup ()
gchar* g_strdup (const gchar *str);
Duplicates a string. The returned string should be freed when no
longer needed.
str : the string to duplicate.
Returns : a newly-allocated copy of str.
"A newly-allocated copy of str."
I suppose it could have an entire paragraph that details how it happens
to use g_new() and strcpy() underneath... but really...
Anybody who has ever used C before for any length of time, knows what
strdup() is. One would assume that g_strdup() worked very similar to
strdup()...
I suggest you read the documentation over once before beginning.
mark
--
[EMAIL PROTECTED][EMAIL PROTECTED][EMAIL PROTECTED] __________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada
One ring to rule them all, one ring to find them, one ring to bring them all
and in the darkness bind them...
http://mark.mielke.cc/
_______________________________________________
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list