Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Neil Cerutti Newsgroups: comp.lang.python Subject: Re: Python Front-end to GCC Date: 22 Oct 2013 17:37:30 GMT Organization: Norwich University Lines: 19 Message-ID: References: <4012031f-5334-4be8-a673-e0d8c8917fb2@googlegroups.com> <5264dbbe$0$30000$c3e8da3$5496439d@news.astraweb.com> <5265bba8$0$29981$c3e8da3$5496439d@news.astraweb.com> <526668e5$0$29981$c3e8da3$5496439d@news.astraweb.com> <52669852$0$29981$c3e8da3$5496439d@news.astraweb.com> <5266aa80$0$29981$c3e8da3$5496439d@news.astraweb.com> <5266b496$0$29981$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net nPajgD2uJ0qsH+K2QtjXkgEsvYPufjXJajayOdqgC5eAHg67D1 Cancel-Lock: sha1:aiKEiMmwc1Cq0s1o0xrkKsGz+ik= User-Agent: slrn/0.9.9p1/mm/ao (Win32) Xref: csiph.com comp.lang.python:57282 On 2013-10-22, Steven D'Aprano wrote: > On Tue, 22 Oct 2013 16:53:07 +0000, Frank Miles wrote: > > [snip C code] >> What you're missing is that arr[] is an automatic variable. Put a >> "static" in front of it, or move it outside the function (to become >> global) and you'll see the difference. > > Ah, that makes sense. Thanks to everyone who corrected my > misunderstanding. > > Well, actually, no it doesn't. I wonder why C specifies such > behaviour? Why would you want non-global arrays to be filled > with garbage? Fish(enc)ey. -- Neil Cerutti