Xref: utzoo comp.lang.c:9350 comp.arch:4350 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!mordor!sri-spam!sri-unix!quintus!ok From: ok@quintus.UUCP (Richard A. O'Keefe) Newsgroups: comp.lang.c,comp.arch Subject: Re: Bit Addressable Architectures Message-ID: <878@cresswell.quintus.UUCP> Date: 15 Apr 88 03:56:47 GMT References: <11702@brl-adm.ARPA> <243@eagle_snax.UUCP> <2245@geac.UUCP> <23396@bbn.COM> Organization: Quintus Computer Systems, Mountain View, CA Lines: 19 In article <23396@bbn.COM>, emiller@bbn.com (ethan miller) writes: > In article <877@cresswell.quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: > =>In article <8646@eleazar.Dartmouth.EDU>, major@eleazar.Dartmouth.EDU (Lou Major) writes: > =>> sizeof (foo) == sizeof (char *) > =>Wrong. The answer *is* 16. This is one of the few cases where > =>foo and &(foo[0]) are different. I _tried_ this to make sure I was right. > =>That's always a good idea. > Sure is. What did you try? _I_ just tried printing foo and &(foo[0]), and > they are the same. BTW, I also tried sizeof (foo), and it is 16. foo and &(foo[0]) as expressions have different types: foo : array-of-16-chars &(foo[0]) : pointer-to-char sizeof notices this difference. In almost any other context, there is an implicit conversion to pointer-to-char form. In particular, print() is not going to reveal the difference. Consider short x = 1; int y = 1; printf("%d %d\n", x, y); Printing obscures the difference between x and y, and in just the same way it obscures the difference between foo and &(foo[0]).