Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!ncar!tank!uxc!uxc.cso.uiuc.edu!uxg.cso.uiuc.edu!phil From: phil@uxg.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Subroutine layout in C Message-ID: <2800002@uxg.cso.uiuc.edu> Date: 20 Dec 88 21:24:00 GMT Lines: 13 Nf-ID: #N:uxg.cso.uiuc.edu:2800002:000:667 Nf-From: uxg.cso.uiuc.edu!phil Dec 20 15:24:00 1988 I want to write a subroutine in C, called S. I want S to be known outside. I also want to have two subroutines X and Y to be known ONLY to S (not known outside of S). Either can be called by S, and each calls the other in a recursive way. I also need to share several variables entirely within this context (shared between S, X, Y). They can be static. There will only be 1 instance of S (and therefore also of X and Y, but that should be hidden). Main program M should be able to call S, but any references to X and Y will not be resolved by the module S. How do I lay out the arrangement of source for S? An example would be appreciated. Thanks. --Phil--