Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!accuvax.nwu.edu!tank!uxc!deimos.cis.ksu.edu!unmvax!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcvax!ukc!warwick!geoff From: geoff@cs.warwick.ac.uk (Geoff Rimmer) Newsgroups: comp.lang.c Subject: Re: function casting Message-ID: <1799@ubu.warwick.UUCP> Date: 1 May 89 03:43:38 GMT References: <12481@umn-cs.CS.UMN.EDU> Sender: news@warwick.UUCP Organization: Computer Science, Warwick University, UK Lines: 30 In-reply-to: clark@umn-cs.CS.UMN.EDU's message of 29 Apr 89 22:55:23 GMT In article <12481@umn-cs.CS.UMN.EDU> clark@umn-cs.CS.UMN.EDU (Robert P. Clark) writes: > How do I cast something to a pointer to a function that returns > an integer? The way I use is to imagine I am defining a variable x to be a pointer to function returning int. I would use: int (*x)(); To change this into a cast, take out the x, and put the whole lot in parentheses. (int (*)()) Get the cdecl program! It will do all of this for you. Hope this helps. Geoff /---------------------------------------------------------------\ | GEOFF RIMMER - Friend of fax booths, ANSI C, PCBH, | | & MPFC & cdecl | | email : geoff@uk.ac.warwick.emerald | | address : Computer Science Dept, Warwick University, | | Coventry, England. | | PHONE : +44 203 692320 (10 lines) If I'm out please | | leave a message with my secretary. | | FAX : +44 865 726753 | \---------------------------------------------------------------/