| From | Sent On | Attachments |
|---|---|---|
| Matt | Apr 4, 2005 11:43 am | |
| Devon H. O'Dell | Apr 4, 2005 11:49 am | |
| Marc Olzheim | Apr 4, 2005 11:49 am | |
| Joerg Sonnenberger | Apr 4, 2005 11:51 am | |
| Dan Nelson | Apr 4, 2005 11:55 am | |
| Mike Meyer | Apr 5, 2005 4:50 am | |
| gilles chehade | Apr 5, 2005 4:50 am | |
| Dunceor . | Apr 5, 2005 4:50 am | |
| ra...@redshift.com | Apr 5, 2005 5:25 am | |
| Peter Jeremy | Apr 7, 2005 1:36 am | |
| Stijn Hoop | Apr 7, 2005 1:39 am | |
| ra...@redshift.com | Apr 7, 2005 1:50 am | |
| ra...@redshift.com | Apr 7, 2005 1:51 am | |
| Zera William Holladay | Apr 7, 2005 7:24 am | |
| Robert Watson | Apr 7, 2005 12:08 pm | |
| Michael Shalayeff | Jul 7, 2005 12:08 pm | |
| chaton | Jul 7, 2005 12:08 pm | |
| Juan J. Martínez | Jul 7, 2005 12:10 pm | |
| Juan J. Martínez | Jul 7, 2005 12:10 pm | |
| Mike Meyer | Jul 8, 2005 12:25 pm |
| Subject: | C programming question | |
|---|---|---|
| From: | Michael Shalayeff (mic...@lucifier.net) | |
| Date: | Jul 7, 2005 12:08:55 pm | |
| List: | org.freebsd.freebsd-hackers | |
Making, drinking tea and reading an opus magnum from Juan J. [Mart_nez]: [Charset ISO-8859-1 unsupported, filtering to ASCII...]
El lun, 04-04-2005 a las 11:43 -0700, Matt escribis:
[...] Can someone break down these declarations (if that's what they are)? Is this a form of typecasting? Thanks for your help.
Those are declarations of pointers to functions.
/* real function */ void dumb(int a) { return a; }
warning: `return' with a value, in function returning void
...
/* here follows a declaration of func pointer */ int (*func_ptr)(int); int a;
/* assign it */ func_ptr=dumb;
warning: assignment from incompatible pointer type
/* use it */ a=func_ptr(123);
Any good book about C should cover this. Look for OOP in C also, it's frequent use pointers to functions + structs to add classes to C.
perhaps you should read that book first (:
cu
-- paranoic mickey (my employers have changed but, the name has remained)





