Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!brl-adm!adm!kcfy@hp1.ccs.cornell.EDU From: kcfy@hp1.ccs.cornell.EDU (Oya Ekin) Newsgroups: comp.lang.c Subject: reply to GEORGE KRYKARISS Message-ID: <11829@brl-adm.ARPA> Date: 15 Feb 88 04:22:56 GMT Sender: news@brl-adm.ARPA Lines: 46 GEORGE KYRIAZISSS writes :: > Hello world. I first found that peculiar behaviour trying to > write a computer graphics program involving points, lines and polygons. > Anyway, here it is: > > int (*lines)[2]; > main() {} > >is a dummy program that just defines this data structure. What I actually >want is a pointer to arrays of 2 ints. I believe that int *lines[2] will >do the reverse, ie. give me two pointers to int. >Anyway, when I run it thru dbx on a SUN and ask 'whatis lines' I get this: > > int (*lines)[8196]; > >As far as I know, this is a *BIG* mistake? Or am I wrong? > > I do not quite understand how you are going to use a declaration like the one you gave. BUT You are right ... I compiled this on Vax it gives me array[0..1] of (*lines) but I do not understand how you are going to use this even if it is declared correctly as in VAX. MAYBE you need something like : int *lines ; main() { lines = calloc(2*n,sizeof(int)) ; } to create arrays of 2 ints refernced as for example for a point : line[n] for x and line[n+1] for y ; Am I right ? OR do you need it for anything else .. ******************************************************************** * MALAGAS ......?? ********************************************