Re: gint to gchar: g_sprintf
- From: "Miguel Pignatelli" <pignatelli noraybio com>
- To: <gtk-app-devel-list gnome org>
- Subject: Re: gint to gchar: g_sprintf
- Date: Fri, 19 Dec 2003 12:16:43 +0100
Hi,
gint add = 10;
you should declare here gchar *addid:
gchar *addid = NULL;
and before the call to g_sprintf you should assign enough memory for this
variable too, for example:
addid = (gchar *) g_malloc (25);
will make addid to point to a piece of memory of 25 bytes (of chars)
g_sprintf(gchar *addid,"%d", add);
you should ommit the type specification of addid:
g_sprintf (addid, "%d", add);
Good luck,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]