Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!jarthur!jseidman From: jseidman@jarthur.Claremont.EDU (Jim Seidman) Newsgroups: comp.lang.c Subject: Using sizeof() on a parameter array Message-ID: <12151@jarthur.Claremont.EDU> Date: 18 May 91 16:25:02 GMT Organization: Headland Technology, Fremont, CA Lines: 23 I ran into this using Microsoft C 6.00A, and wanted to know if this was a bug in MSC or the way an ANSI C compiler really should work. Consider the following function: 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). The ANSI K&R doesn't address this issue explicitly. Any definitive answers on what should happen? -- Jim Seidman, Headland Technology, 46221 Landing Parkway, Fremont CA 94538 "It doesn't need to work. They'll be paralyzed laughing at me." - The Doctor, "Shada"