Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rutgers!netnews.upenn.edu!cps3xx!bruey From: bruey@cpsin3.cps.msu.edu (Donald E Bruey) Newsgroups: comp.lang.c Subject: pointers to functions Message-ID: <6284@cps3xx.UUCP> Date: 3 Feb 90 19:11:56 GMT Sender: usenet@cps3xx.UUCP Reply-To: bruey@cpsin3.cps.msu.edu (Donald E Bruey) Distribution: usa Organization: Dept. of Computer Science, Michigan State University Lines: 33 Is it dumb question time already this year? Well, since someone has to ask the first one, it may as well be me. Can some gracious .netlander please mail me some hints ( a program is also quite acceptable) on passing around pointers to functions? Specifically, I've been doing a lot of numerical methods in programs and having to call four or five functions in each program. I don't want to have to copy the code five times, as in if (count = /* value */) then do this function else if (count = /* another value */) then do _this_ functino etc I would rather call it like this subroutine ( pointer_to_function,initial_value); subroutine ( pointer_to_function_II, initial_value); and so on. this would make my life a lot easier, but I found K&R a bit difficult to understand on this issue (surprise!!). Can anyone help me? Thanks in advance. If you do send something, mail is much more reliable than reply. bruey@cpsin3.cps.msu.edu or even bruey@cpsvax.egr.msu.edu