Complex data type
31-May-90 20:58:52
Sb: #107193-Complex data type
Fm: JEFFREY C. DEGE 76426,211
To: Syndesis 76004,1763
I was mainly trying to show a way of dealing with extremely complex data
types on compilers that choke on them. The array in question was proposed
by the author of the message I was replying to. As for accessing an
individual int from within this kind of mess, I've never needed to (and
find it hard to believe that anybody else would, either.) I've played
around with a program or two that may have had this complicated a data
type, but I tend to think in terms of the intermediate types.
As an example, I might have:
typedef struct {int real, imaginary;} complex;
typedef complex vector[4];
typedef vector matrix[4];
matrix foo[10];
From within the function that declares foo, I would NEVER access the
ints that base this mess. I'd hate to try to figure out how to access the
real component of the second complex number in the third vector of the
fourth matrix in foo. I just don't think that way. Like I said, if you
have a datatype this messy and you need to access the individual ints at
every point in your program, then your program needs some serious design
work.