Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!brl-adm!brl-smoke!smoke!dietz%slb-doll.csnet@CSNET-RELAY.ARPA From: dietz%slb-doll.csnet@CSNET-RELAY.ARPA Newsgroups: net.lang.c Subject: Re: Pointers to arrays in C Message-ID: <2389@brl-smoke.ARPA> Date: Fri, 4-Apr-86 23:03:37 EST Article-I.D.: brl-smok.2389 Posted: Fri Apr 4 23:03:37 1986 Date-Received: Wed, 9-Apr-86 07:52:20 EST Sender: news@brl-smoke.ARPA Lines: 26 >> int (*x)[10]; > >That is not a pointer to an array. It is an array of pointers to ints. > George Tomasevich, ihnp4!twitch!grt > AT&T Bell Laboratories, Holmdel, NJ It *is* a pointer to an array. Try running this program: main() { char (*x)[10]; printf("%d\n%d\n%d\n", sizeof(*x), sizeof(x), sizeof((*x)[2])); } It prints (on a VAX running ULTRIX): 10 4 1 So, *x is an object of size 10 (the array), x is an object of size 4 (a pointer), and (*x)[2] is a single byte (a char). C's strange type syntax strikes again. Paul Dietz dietz@slb-doll.csnet