Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!xanth!nic.MR.NET!umn-d-ub!umn-cs!clark From: clark@umn-cs.CS.UMN.EDU (Robert P. Clark) Newsgroups: comp.lang.c Subject: function casting Message-ID: <12481@umn-cs.CS.UMN.EDU> Date: 29 Apr 89 22:55:23 GMT Organization: University of Minnesota, Minneapolis Lines: 30 How do I cast something to a pointer to a function that returns an integer? I'm trying to save the old function, so that I can call my own function and then chain to the original. One of my (failed) attempts has been main() { int (*f)(); char *foo(); f = ((*int)())foo(); /* foo returns char*, but I know this is */ /* really an address of a function */ } Bob Clark clark@umn-cs.cs.umn.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ ~ ~ Never underestimate the bandwidth of ~ ~ a station wagon - Andrew Tannenbaum ~ ~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~