Path: utzoo!attcan!uunet!husc6!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.std.c Subject: Re: Can the address of a variable change during a function? Message-ID: <8938@smoke.BRL.MIL> Date: 20 Nov 88 02:05:16 GMT References: <6472@june.cs.washington.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 25 In article <6472@june.cs.washington.edu> pardo@cs.washington.edu (David Keppel) writes: >I can imagine, however implementations in which the address >of a variable is not constant throughout the function (see below). The cases where this would be permissible are so rare as to make it practically certain no compiler implementor would bother to do so. You may safely write your code as though storage for a variable does not move during its lifetime (except through an explicit realloc()). Automatic variables do go out of scope upon exit from the block that defines them, but they don't move around within the duration of the block. >In this case, the behavior of the program will be *very* >different than if the variables had been declared with > auto int i; > int j; No, the "auto" was implicit in the previous example. In fact there is no real use for an explicit "auto" keyword in C. >I also belive that 'auto' has been removed from dpANS C. No, it's listed as a storage class specifier in section 3.5.1. Where do you get these strange beliefs?