Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!sdcc6!sdcc13!pa1412 From: pa1412@sdcc13.ucsd.edu (pa1412) Newsgroups: gnu.gcc Subject: Re: A question on local variable allocation Message-ID: <8065@sdcc6.ucsd.edu> Date: 1 Mar 90 21:27:08 GMT References: <25E58087.11649@paris.ics.uci.edu> <6915@internal.Apple.COM> <25EAFE2C.2545@paris.ics.uci.edu> Sender: news@sdcc6.ucsd.edu Organization: University of California, San Diego Lines: 30 In article <25EAFE2C.2545@paris.ics.uci.edu> rfg@ics.uci.edu (Ronald Guilmette) writes: >In article <6915@internal.Apple.COM> escher@Apple.COM (Michael Crawford) writes: >>In article <25E58087.11649@paris.ics.uci.edu> rfg@paris.ics.uci.edu (Ronald Guilmette) writes: ...Can someone please explain to me why, in the following code, the space ...allocated for the two local array variables does not overlap? ..... ... void function () ... { ... { ... int inside1[1024]; ... ... g (inside1); ... } ... ... { ... int inside2[1024]; ... ... g (inside2); ... } ... } From K & R the scope rule for the variables is to the matching brace. However how the storage is allocated is clearly implementation dependent. What is the ANSI C scope rule defined? -- John Clark jclark@ucsd.edu pa1412@iugrad2.ucsd.edu