Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!paperboy!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Using sizeof() on a parameter array Message-ID: <16195@smoke.brl.mil> Date: 20 May 91 04:13:22 GMT References: <12151@jarthur.Claremont.EDU> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 12 In article <12151@jarthur.Claremont.EDU> jseidman@jarthur.Claremont.EDU (Jim Seidman) writes: -void test(char param[80]) { - char local[80]; - printf("sizeof(param) = %d\n", sizeof(param)); - printf("sizeof(local) = %d\n", sizeof(local)); -} -Now, I thought that this should print out the same size for both, namely -80. But according to MSC, local has a size of 80, and param has a size -of 2 (the size of a pointer). MSC is right. The parameter DOES have type pointer-to-char; you've just written in in an opaque way.