GtkLabel and text from int variable



Hi, 

is there a possibility to put a value of int variable as a text of GtkLabel. I tried to do it
in that way:

int var = 100;
char* buf[11];
sprintf(buf, "%i%c", var, 0);
gtk_label_set_text(gtk_label, buf);

or with no null character sprintf(buf, "%i", 100).

Neither of them works. How can i do that?
Pleas help.

Przemek



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