Xref: utzoo comp.lang.c++:6433 comp.lang.c:25861 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!mit-eddie!uw-beaver!uw-entropy!dataio!bright From: bright@Data-IO.COM (Walter Bright) Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: Zortech "limitation" Message-ID: <2328@dataio.Data-IO.COM> Date: 12 Feb 90 20:00:08 GMT References: <4895d648.20b6d@apollo.HP.COM> Reply-To: bright@Data-IO.COM (Walter Bright) Followup-To: comp.lang.c++ Distribution: usa Organization: Data I/O Corporation; Redmond, WA Lines: 52 Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: Zortech "limitation" Summary: Expires: References: <48910321.20b6d@apollo.HP.COM> Sender: Reply-To: bright@Data-IO.COM (Walter Bright) Followup-To: Distribution: usa Organization: Data I/O Corporation; Redmond, WA Keywords: In article <48910321.20b6d@apollo.HP.COM> nelson_p@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.