home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!usc!rpi!batcomputer!ghost.dsi.unimi.it!univ-lyon1.fr!taloa.unice.fr!beust
- From: beust@aurora.unice.fr (Cedric Beust)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: How should I learn C?
- Date: 30 Dec 1992 10:15:34 +0100
- Organization: University of Nice Sophia-Antipolis, France
- Lines: 25
- Distribution: world
- Message-ID: <1hrpbmINNim3@aurora.unice.fr>
- References: <rlcarr.09er@animato.network23.com> <C01D36.BDC@unx.sas.com>
- NNTP-Posting-Host: aurora.unice.fr
-
-
- In article <C01D36.BDC@unx.sas.com>, walker@twix.unx.sas.com (Doug Walker)
- writes:
-
- >|> There's nothing in C that should make you use globals where you did not use
- >|> them in Pascal. I don't understand this complaint.
- >
- >Probably the scoping problem - you can declare a "local" in a pascal
- >procedure, and then use it in subprocedures. The answer is to use
- >statics instead of globals, or to place all such variables in a
- >structure and pass the structure to all subroutines.
-
- On a related topic, you (Rick) might want to take a look at p2c.
- It's a Pascal to C converter that will produce C from Pascal code,
- even if it is very Pascal-dependant. This way, you will see how p2c
- handles Pascal-scoping in C. For those of you who have never seen
- this, it is a very interesting experience! Especially if you are
- interested in compilers science.
-
- Basically, the idea is the one described by Doug but it must
- take many other things in account.
-
- --
- Cedric BEUST, beust@sa.inria.fr, Bull Research Koala proj, KoalaBus & xforum
- Pho:(33) 93.65.78.07(.66 Fax), INRIA, B.P.93 - 06902 Sophia Antipolis, FRANCE.
-