Zortech "limitation"
Walter Bright
bright at Data-IO.COM
Tue Feb 13 07:00:08 AEST 1990
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: Zortech "limitation"
Summary:
Expires:
References: <48910321.20b6d at apollo.HP.COM>
Sender:
Reply-To: bright at Data-IO.COM (Walter Bright)
Followup-To:
Distribution: usa
Organization: Data I/O Corporation; Redmond, WA
Keywords:
In article <48910321.20b6d at apollo.HP.COM> nelson_p at apollo.HP.COM (Peter Nelson) writes:
< But I DO need to handle large, 2-dimensional arrays
< and Zortech seems to have a problem with that.
< The problem is that my total global memory will exceed
< 64K, although I am grudgingly willing to settle for having
< no *one* array exceed that size if that would help here.
Instead of having:
int array[N][M]; /* array of N columns */
try:
int (*array[N])[M]; /* array of N pointers to columns */
/* Create the columns */
for (i = 0; i < N; i++)
array[i] = (int (*)[M])malloc(sizeof(int [M]));
#define array_access(i,j) ((*array[i])[j])
(I wrote this off the cuff, so it may have a syntax error, but I've done
this before and it works fine. In fact, it is *faster* than doing huge
arithmetic.)
< If I wanted to do pointer arithmetic all over the place I would
< use Assembler! Zortech C/C++ is allegedly a high-level language
< but their manual describes this as a "limitation" of their product.
< I would call it a bug.
There's no assembler in the example above. One man's bug is another's feature.
C is not a high-level language, it's a "portable assembler", thus the
limitations and capabilities of the underlying instruction set are
reflected in the source code. I occasionally get "bug" reports that the
compiler does not make the PC look like a VAX.
< PS- The Arlington office mentioned a Zortech BBS in Washington
< state which I dialed and got a carrier, but for some reason
< I couldn't talk to it.
The phone number is (206) 822-6907. The BBS works fine, and has been for
years. It gets heavy use. It uses a Hayes 2400 baud external modem. I
suggest you try again.
More information about the Comp.lang.c
mailing list