Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site cyb-eng.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!ut-sally!ut-ngp!cyb-eng!howard From: howard@cyb-eng.UUCP (Howard Johnson) Newsgroups: net.lang.c Subject: Re: C declarations Message-ID: <499@cyb-eng.UUCP> Date: Mon, 11-Feb-85 15:58:51 EST Article-I.D.: cyb-eng.499 Posted: Mon Feb 11 15:58:51 1985 Date-Received: Thu, 14-Feb-85 01:49:21 EST References: <7699@brl-tgr.ARPA> <1752@pucc-h> Organization: Cyb Systems, Austin, TX Lines: 24 >> int ptr[]; declares one pointer >> but >> int ptr[] = { 1, 2, 3 }; declares a three element int array. >> >> Is this a desirable characteristic of C? Could someone please comment on >> the precise meaning of [] in declarations. I wonder who came up with the idea that int foo[]; declares a pointer VARIABLE!? True, foo[n] is EVALUATED as *(foo+n), but I've never understood that this behavior should be extended to declarations. Now I can live with foo[] being called a pointer CONSTANT, but not a pointer variable--at least that's how array declarations are treated by the C compilers I use. > int foobung[3] = {13, 42, 93}, Ack[] = {7, 6}, ichabod[] = foobung; I hope the declaration int ichabod[] = foobung; produces an error on your compiler, since this can be described as: int *ichabod = foobung; -- Howard Johnson Cyb Systems, Austin, TX ..!{gatech,harvard,ihnp4,nbires,noao,seismo}!ut-sally!cyb-eng!howard