Re: http://www.gtk.org/tutorial/sec-anupgradedhelloworld.html
- From: Keith Sharp <kms passback co uk>
- To: gtk-app-devel-list gnome org
- Subject: Re: http://www.gtk.org/tutorial/sec-anupgradedhelloworld.html
- Date: Thu, 17 Feb 2005 12:21:05 +0000
On Thu, 2005-02-17 at 13:05 +0100, Gert Cuykens wrote:
static void callback( GtkWidget *widget, gpointer data ){
g_print ("Hello again - %s was pressed\n", (gchar *) data);
}
why do they put () around gchar ?
why can it not be gchar *data ?
gpointer is a void pointer and the call to g_print is expecting a gchar
pointer, hence the use of (gchar *) to change the pointer type.
What does %s do ?
Same as in printf, look at the man page: man 3 printf.
Are gpointer and gchar global variables of gtk ?
Are gpointer and gchar data types or objects ?
What does gpointer and gchar represent ?
You should consult a beginners guide to C programming so that you can
understand pointers and data types properly. There are also a number of
introductory C tutorials on the web, just search Google.
Keith.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]