Xref: utzoo comp.lang.c:9323 comp.arch:4345 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!amdahl!oliveb!sun!gorodish!guy From: guy@gorodish.Sun.COM (Guy Harris) Newsgroups: comp.lang.c,comp.arch Subject: Re: sizeof behavior (was Bit Addressable Architectures) Message-ID: <49537@sun.uucp> Date: 14 Apr 88 17:26:21 GMT References: <11702@brl-adm.ARPA> <243@eagle_snax.UUCP> <2245@geac.UUCP> <49530@sun.uucp> Sender: news@sun.uucp Followup-To: comp.lang.c Lines: 13 > > char foo[]="This is a test."; > > sizeof (foo) == sizeof (char *) > > Lou, on my machine (Sun 3/60, SunOS 4.0) this is not true; > sizeof (foo) == sizeof foo == 16 > This corresponds with the way I have used sizeof with arrays for > many years now, and in fact the standard unix kernel configuration > files depend on it. Of course, your mileage may vary, but I would like > to hear about any machines where sizeof works the way you state. I'm sure *everybody* would like to hear about any purported C implementations that work the way he states, because they wouldn't be C implementations. "foo[]" is an array of characters, and as such in *any* valid C implementation "sizeof foo" will return the number of "char"s the array takes up, namely 16.