Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!brl-smoke!gwyn
From: gwyn@brl-smoke.ARPA (Doug Gwyn )
Newsgroups: comp.lang.c
Subject: Re: How are local vars allocated?
Message-ID: <6749@brl-smoke.ARPA>
Date: Thu, 26-Nov-87 22:50:47 EST
Article-I.D.: brl-smok.6749
Posted: Thu Nov 26 22:50:47 1987
Date-Received: Sun, 29-Nov-87 18:39:12 EST
References: <9367@mimsy.UUCP> <1633@megatest.UUCP> <1987Nov22.085210.20641@sq.uucp> <2218@killer.UUCP>
Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) )
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 7

In article <2218@killer.UUCP> richardh@killer.UUCP (Richard Hargrove) writes:
>> But the value of "k" is NOT guaranteed to be retained from one iteration
>> to the next, and you must not assume it will be.  If you want that, you
>Yes it is! The variable's scope is the block in which it is defined.

No, execution leaves (and re-enters) the block statement each iteration
of the loop.  The variable goes out of scope each time the block is left.