Date: Sat, 19 Feb 2005 02:57:53 -0700 From: Chad Leigh -- Shire.Net LLC <chad@shire.net> To: Gert Cuykens <gert.cuykens@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: c++ Message-ID: <5b8472dd5925a0b0b59f15cd9f8e15f3@shire.net> In-Reply-To: <ef60af09050219015116024f83@mail.gmail.com> References: <ef60af09050219015116024f83@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Feb 19, 2005, at 2:51 AM, Gert Cuykens wrote:
> On Thu, 17 Feb 2005 13:17:51 +0100, Hubert Soko©©owski
> <h.sokolowski@wsisiz.edu.pl> wrote:
>> On Thu, 17 Feb 2005 13:05:43 +0100
>> Gert Cuykens <gert.cuykens@gmail.com> 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 ?
>>
>> You should learn some more about programming in C before you start
>> writing GTK apps.
>>
>> hs
>
> Does anybody want to explain what the () thingies are around gchar * ?
>
It is a typecast -- coercing "data" to be of type (gchar *) to the
compiler when matching parameter types at compiler time.
Chad
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5b8472dd5925a0b0b59f15cd9f8e15f3>
