Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: sizeof() confusion Message-ID: <14381@smoke.brl.mil> Date: 7 Nov 90 11:38:58 GMT References: <9156@latcs1.oz.au> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 17 In article <9156@latcs1.oz.au> jacob@latcs1.oz.au (Jacob L. Cybulski) writes: >typedef unsigned char Pattern[8]; >void foo (Pattern x) Pattern is an array of 8 chars. x is a pointer to a char. This is the way C has been for years. >The intuition says that sizeof(Pattern) = sizeof(x) regardless of the >Pattern definition. Why are you relying on intuition rather than the language definition? >Now is it the fault of my compiler (THINK C) to give me such a hard time, >is it my bad C programming style, or is it the ANSI standard which has some >gaping semantic holes? I think the problem is your intuition. THINK C is producing correct results.