TIP: Click on subject to list as thread! ANSI
echo: cis.os9.68000.osk
to: Bob van der Poel 76510,2203 (X)
from: Mark Griffith 76070,41
date: 1992-11-23 03:35:15
subject: #17141-12

#: 17152 S12/OS9/68000 (OSK)
    23-Nov-92  03:35:15
Sb: #17141-12
Fm: Mark Griffith 76070,41
To: Bob van der Poel 76510,2203 (X)

Bob,

 >  int (*indexes)[KEYS2];
 >
 > I need to cast p to the type of indexes. Nothing I try seems to work. I
 > thought that "indexes=(int**)p" would work...
 >

The declaration int (*indexes)[26] is different than int *indexes[26]. The
latter making indexes an array of 26 pointers pointing to 26 integers.  The
first is a pointer pointing to an array of 26 integers. It is explained more
clearly like this: indexes[][26].  So it really is a form of a
multi-dimensional array.  You would access the array like this:

        var = indexes[i]  which is the same as var = &indexes[0][i]

So I don't think you can assign a value to indexes since it really isn't a
pointer.  You could do something like int *idx = &indexes and then assign a
value to idx.  Play around with that and see what happens.

I had to look around for an answer to this one.  Found it in my Plum Hall book
"Reliable Data Structures in C".


                  /*-------------  /\/\ark -------------*/

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.