Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!agate!eris.berkeley.edu!mwm From: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) Newsgroups: comp.sys.amiga.tech Subject: Re: Can you nest subroutines in C? Message-ID: <25874@agate.BERKELEY.EDU> Date: 29 Jun 89 06:08:03 GMT References: <4495@crash.cts.com> Sender: usenet@agate.BERKELEY.EDU Reply-To: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) Organization: Missionaria Phonibalonica Lines: 39 In article <4495@crash.cts.com> wade@pnet01.cts.com (Wade Bickel) writes: < So far I have found nothing I could do in C that I could not do in > In fact, if you declare a function (or a variable external to a function) >> to be static, it will be local to the source file but global to all functions >> within that file. Not quite. C (like many other languages) reqiures forward declarations. Functions and variables are only visible to code that occurs after their decleration in the file. And an external variable declared in a function only has function scope in ANSI C. In pre-ANSI C, the scope wasn't explicitly defined, and PCC based compilers gave it file scope.