Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!crdgw1!crdos1!davidsen
From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr)
Newsgroups: comp.lang.c
Subject: Re: Declaration within a loop.
Message-ID: <559@crdos1.crd.ge.COM>
Date: 27 Sep 89 15:22:20 GMT
References: <2085@hydra.gatech.EDU> <30174@news.Think.COM>
Reply-To: davidsen@crdos1.UUCP (bill davidsen)
Distribution: usa
Organization: GE Corp R&D Center
Lines: 16

In article <30174@news.Think.COM>, barmar@kulla (Barry Margolin) writes:

|  Yes, a new i variable is declared.  However, at the end of each time
|  through the loop it is "undeclared", so it can be deallocated.  Most C
|  implementations will actually use the same memory location (probably
|  on the stack) each time. 

  Most C compilers allocate space on the stack for this when the
procedure is entered. It therefore is not a practical thing to do to
save space. The most common use is to correct for having forgotten to
declare a variable at the start of a procedure.
-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon