home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c
- Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!destroyer!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!chsun!bernina!hoesel
- From: hoesel@igc.ethz.ch (Frans van Hoesel)
- Subject: typedef void (*generic)()
- Message-ID: <1992Dec16.172748.24120@bernina.ethz.ch>
- Sender: news@bernina.ethz.ch (USENET News System)
- Organization: University of Groningen, the Netherlands
- Date: Wed, 16 Dec 1992 17:27:48 GMT
- Lines: 31
-
- Hi,
-
- I have a problem in doing what I want to do in c.
-
- a smaal exaplme
- #include <stdio.h>
- #include <stdlib.h>
-
- typedef void (*generic)();
-
- main() {
- generic f,g;
- int i;
- f = (generic) printf;
- g = (generic) abs;
-
- i=-4;
-
- /* and now do something like :printf("some text %d\n",abs(i)
- ), but using f and g instead !*/
- }
- This isn't the right group to ask (I know), but propably the best
- There is also a remark from my compiler on some constructs stating that void pointer cannot be cast to function pointers. Is this allowed?
-
- -- frans
-
-
- --
- ================================================================
- === frans van hoesel hoesel@igc.ethz.ch ===
- ================================================================
-