Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Auto variable with sizeof == 0 Message-ID: <5284@mimsy.UUCP> Date: Wed, 4-Feb-87 12:54:58 EST Article-I.D.: mimsy.5284 Posted: Wed Feb 4 12:54:58 1987 Date-Received: Sat, 7-Feb-87 06:43:28 EST References: <4114@brl-adm.ARPA> <397@mipos3.UUCP> <14575@amdcad.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 18 >>>"struct foo **bar[]". >In article <397@mipos3.UUCP> pinkas@mipos3.UUCP (Israel Pinkas) writes: >>I don't see the problem with this declaration. ... >> >> bar = malloc(sizeof(struct foo) * 100) In article <14575@amdcad.UUCP> tim@amdcad.UUCP (Tim Olson) writes: > ^^ Won't work; bar is a *constant* (see pp 94, 95 of K&R) To be picky, bar is neither a constant nor a variable. Its value is set at entry to the function, and cannot be changed within that function invocation---not without cheating: all automatic variables are really just names for stack frame offsets, so altering the stack or frame pointer shuffles all the variables. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) UUCP: seismo!mimsy!chris ARPA/CSNet: chris@mimsy.umd.edu