Re: Threads & Glade
- From: Roger Leigh <rleigh whinlatter ukfsn org>
- To: lucapetra <lucapetra gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Threads & Glade
- Date: Mon, 10 Oct 2005 13:46:09 +0100
On Mon, Oct 10, 2005 at 04:52:48AM -0700, lucapetra (sent by Nabble.com) wrote:
Now i have another question. How can I cast a gpointer to a struct?
It seems to be very hard to do :(
Not really:
struct foo orig;
gpointer gptr = (gpointer) &foo; // gpointer from pointer-to-struct
struct foo *fptr = (struct foo *) gptr // pointer-to-struct from
// gpointer.
Now to get the struct back, just dereference the pointer (*fptr).
Remember that "gpointer" is just "void *".
Regards,
Roger
--
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]