Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site pucc-h Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!inuxc!pur-ee!CS-Mordred!Pucc-H:ag4 From: ag4@pucc-h (Angus Greiswald the fourth) Newsgroups: net.lang.c Subject: Re: C declarations Message-ID: <1752@pucc-h> Date: Tue, 29-Jan-85 12:21:07 EST Article-I.D.: pucc-h.1752 Posted: Tue Jan 29 12:21:07 1985 Date-Received: Thu, 31-Jan-85 01:59:15 EST References: <7699@brl-tgr.ARPA> Organization: your service Lines: 23 > 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. Well, I look at it this way: foo[] is an array whose location and/or size is variable and thus needs to be declared as a pointer, and biff[4] is a fixed size array whose location is constant, and thus biff can be declared as a constant. When there is an initializer, you can explicitly declare the size of an array, leave the compiler to count for itself, or specify it to be non-fixed in size and position with an initial value. int foobung[3] = {13, 42, 93}, Ack[] = {7, 6}, ichabod[] = foobung; Of course, int *foo is a different matter. Hope I covered what you were interested in. -- Jeff Lewis vvvvvvvvvvvv {decvax|ucbvax|allegra|seismo|harpo|teklabs|ihnp4}!pur-ee!lewie ^^^^^^^^^^^^