🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #237

Re: Can you nest subroutines in C?

#237
From: Panzer, John Robert
Date: Wed, 28 Jun 1989 21:33
20 lines
1801 bytes
In article <14753@watdragon.waterloo.edu> sjorr@rose.waterloo.edu (Stephen Orr) writes:
>In article <4470@crash.cts.com> wade@pnet01.cts.com (Wade Bickel) writes:
>>    I hope there is a way to create nested functions in C.  In general I find
>>I like C.  Especially the flexability of conditionals afforded in pointer
>>manipulations, which is much more powerful than that allowed in Modula-2.
>
>	Unless someone changed the definition of C that I learnt, all 
>modules in 'C' have the same visibility even main(). This does not mean you
>can't get your peice of code running, it just means that the sub-module you
>would place with a larger module will be visible to all modules in the program.

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.  This provides some degree of modularity, although
it does require that each module be in a separate source file.
 
==========================================================================
| John Panzer           |   UC Santa Barbara                             |
| panzer@cornu.ucsb.edu |               Department of Computer Violence  |
==========================================================================
Technical Details
Message-ID: <2042@hub.ucsb.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!ucsbcsl!grape!panzer
References: <4470@crash.cts.com> <14753@watdragon.waterloo.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!ucsbcsl!grape!panzer
From: panzer@grape.ucsb.edu (Panzer, John Robert)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Can you nest subroutines in C?
Message-ID: <2042@hub.ucsb.edu>
Date: 28 Jun 89 21:33:27 GMT
References: <4470@crash.cts.com> <14753@watdragon.waterloo.edu>
Sender: news@hub.ucsb.edu
Reply-To: panzer@grape.UUCP (Panzer)
Organization: University of California, Santa Barbara
Lines: 20