Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!uhccux!munnari.oz.au!cluster!ultima!fidogate From: rick_jones@f616.n713.fido.oz (Rick Jones) Newsgroups: comp.lang.c Subject: questionnaire Message-ID: <17142@ultima.cs.uts.oz> Date: 17 Jan 90 21:32:23 GMT Sender: fido@ultima.cs.uts.oz Organization: A Fidonet node, gated through ultima.cs.uts.oz Lines: 39 Original to: phil@ux1.cso.uiuc.edu In a message of <12 Jan 90 02:20:39>, phil@ux1.cso.uiuc.edu (3:713/603) writes: pA>1. Whether or not to use "typedef" for a "struct" pA> a. how do you deal with the case of two different struct types pA> having pointers to the other type? Depends on the program. I quite often use typedef struct to define structures so that I may then reference them by their new type. pA>2. When you decide to separate structures into header files pA> a. how big must the program be to warrant this? pA> b. do you always do so? pA> c. never? d. Whenever there is a reasonable chance that the same structures will be used in two or more programs/modules. pA>3. Making functions used (in many places) only by your program extern pA> a. what if only one program calls this function? Same as above. if the function is useful enough to be used in more than one program/module, it finds its way into the library. pA>4. Do you consider passing a "pointer to a function" to another pA>function pA> which will (blindly?) use it to call that function, a "kosher" pA> programming practice? I don't know about blindly, but yes I have quite a few programs that do that. particularly my format() module that does all the work for printf, fprintf, lprintf, etc. is called with the pointer to an output function, allowing one function to perform multiple roles. Rick. --- msged 1.99S ZTC * Origin: /\/\onitor \/\/orld, Sydney 'Where you can C forever...' (3:713/616)