Re: string concatanation



Thanks, I was getting segfaults with %s.
Also, another non-gtk, but related issue. I need to be able to
open/display and save text files. I know how to do the display part, but
I don't know the file io aspects. So, given a filename, how can I access
it for a text display, and save text to that file? Are there any good c
file access tutorials on the net?
Thanks for any help.

On Tue, 2002-08-20 at 13:25, Tristan Van Berkom wrote:
sorry .... it will obviously be "%d" not "%s" (oops)





Tristan Van Berkom wrote:

I think you want something like this:

{
    gchar *allocated_string = g_strdup_printf("var=%s", ((gint)ENUM));

    ...

    g_free(allocated_string);
}

Cheers.

Jacob Perkins wrote:

This is isn't directly related to gtk, but it's for a gtk project.
I've programmed in java and c++, but not straight c, so I'm wondering
how to concatanate a string.
Here's my situation: I have a set of enums, some of which are
configuration defaults. I'd like to be able to do 'var =
gnome_config_private_get_int("var="+ENUM)', so that the default value of
var is ENUM, but that doesn't seem to work in c. So, how can I specify
this default int value without knowing the specific ENUM int value?
Thanks

--
pub  1024D/57DDD9E3 2002-05-24 Jacob (Direct to Home)
<jap1 rig dyndns ws>
Key fingerprint = 1E02 A5FD 8162 4322 C674  6E67 05EB 30F1 57DD D9E3
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
-- 
pub  1024D/57DDD9E3 2002-05-24 Jacob (Direct to Home)
<jap1 rig dyndns ws>
Key fingerprint = 1E02 A5FD 8162 4322 C674  6E67 05EB 30F1 57DD D9E3



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