Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!cmcl2!brl-adm!adm!jfjr@mitre-bedford.arpa From: jfjr@mitre-bedford.arpa Newsgroups: comp.lang.c Subject: Can this be done Message-ID: <8125@brl-adm.ARPA> Date: Wed, 1-Jul-87 14:40:20 EDT Article-I.D.: brl-adm.8125 Posted: Wed Jul 1 14:40:20 1987 Date-Received: Fri, 3-Jul-87 01:45:56 EDT Sender: news@brl-adm.ARPA Lines: 27 I posted this sometime back but it appears to have been lost so I am posting it again. If its redundant I have screwed up and I apologize. Suppose I have defined a structure type with one of the components a pointer to a function. For simplicity's sake the function takes no parameters and returns void. Suppose further I declare, in one module an array of such structures and in that same module (compilation unit) I define(declare??) a function we'll call "install" which takes a one of these function pointer structures as a parameter, searches through the array for an empty spot and copies the structure into it. Now, in another, separate module I have an instance of my function pointer structure and the function (call it my_function) it points to is also in this module. I make NO attempt to make this function visible outside the module. I make "install" visible and in fact I call it to install this structure into the array described above. Can I loop through my array and call the functions in it even though none are declared external anywhere? is this legal? possible but not legal?? done every day?? - how far can I push this?? Any comments are welcome Jerry Freedman,Jr jfjr@mitre-bedford.arpa