home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!darwin.sura.net!jvnc.net!gmd.de!Germany.EU.net!mcsun!sunic!seunet!swbull!hemulen.bull.se!elias
- From: elias@proxxi.se (Elias M}rtensson (proxxi))
- Subject: Re: Functions Within Functions
- Message-ID: <1992Jul29.235330.2027@proxxi.se>
- Organization: proxxi
- References: <Bs5w39.5ox@news.larc.nasa.gov>
- Date: Wed, 29 Jul 1992 23:53:30 GMT
- Lines: 26
-
- wjb@cscsun2.larc.nasa.gov (William J. Bene) writes:
-
- >Is there any way to declare functions within another function like in pascal?
-
- Yes, GCC can do this, but since it isn't compatible with other versions
- of C, I wouldn't do it unless I really needed to.
-
- In GCC You can write something like:
-
- int foo()
- {
- int bar( int a ) { return a + 20; }
-
- printf( bar( 10 ) );
- }
-
- >================================
- >William J. Bene
- >Computer Sciences Corporation
- >wjb@cscsun2.larc.nasa.gov
-
- ###################
- # Elias Martenson #
- # elias@proxxi.se #
- ###################
-
-