Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!snorkelwacker!spdcc!ima!cfisun!lakart!dg From: dg@lakart.UUCP (David Goodenough) Newsgroups: comp.lang.c Subject: Re: (* func)(fred, bert) Message-ID: <744@lakart.UUCP> Date: 9 Nov 89 15:41:11 GMT References: <2387@stl.stc.co.uk> Organization: Lakart Corporation, Newton, MA Lines: 39 dsr@stl.stc.co.uk (David Riches) sez: > I want a function with the following interface, that does some actions > when a signal activates it :- > > VOID error(code, status) ..... > VOID main() > > { > signal(SIG_ALARM, error(101, &stat); <----------------- (B) You can do this quite easily, but it takes a global variable and an additional procedure: void error(code, status) int code, *status; { etc. } int stat; void error101() { error(101, &stat); } void main() { signal(SIG_ALARM, error101); etc. } -- dg@lakart.UUCP - David Goodenough +---+ IHS | +-+-+ ....... !harvard!xait!lakart!dg +-+-+ | AKA: dg%lakart.uucp@xait.xerox.com +---+