Re: string concatanation



He's got a point ... I recommend
        Advanced programming in the UNIX Environment
by W. Richard Stevens

for the same price range as a basic C bible you'll
get basic algorithmes for Interprocess Communication
databases and all kinds of interesting stuff.


Thomas Cameron wrote:

Jacob,

        I think your best bet is to purchase a C book for your
particular platform (Linux, Windows, etc.).  These books usually discuss
(some more in-depth than others) basic file I/O functions.  They will
also discuss concatenation, general language in's and out's, etc.

        You will find such information indisposable when working on
projects, as you may find yourself refering back to them time and again.
Also, if you are programming for Linux, there are _countless_ books,
HOWTOs, Guides, and other forms of information available...many for
FREE.

Good luck,
Tom Cameron

-----Original Message-----
From: Jacob Perkins [mailto:jap1 ionet net]
Sent: Tuesday, August 20, 2002 2:56 PM
To: Tristan Van Berkom
Cc: gtk-app-devel-list gnome org
Subject: 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 _______________________________________________
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



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