Should I convert FORTRAN code to C?

Alan J Rosenthal flaps at dgp.toronto.edu
Wed Jul 13 01:09:25 AEST 1988


16012_3045 at uwovax.uwo.ca (Paul Gomme) writes:
>>Am I totally missing something, or is this not a multidimensional array:
>>int array[10][15];
>>??

swarbric at tramp.Colorado.EDU (Frank Swarbrick) writes:
>Try that sort of thing under MS-DOS, with a _BIG_ matrix -- try
>something like:
>	int array[200][200];
>I've tried this sort of thing with Turbo C, and know someone who checked out
>MSC for me.  The compiler choked on it because the array exceeds 64K.  However,
>I've used a Fortran compiler which will let me create such matrices with
>absolutely no complaint.

GEE, this is not part of the C language.  The purpose of a compiler
is to hide, or possibly, in the case of MS-DOS, apologize for, the
architecture.  If you declare an object of greater size than 64K,
pointers to it should use a different segment register value for
accesses to elements 32768 and beyond.

This isn't harder to do in C than in Fortran.  In Fortran under MS-DOS
you would also have to have every function decide for each of its
input parameters whether it is a pointer-to-64K-or-less or a
pointer-to-more-than-64K.

Don't judge the C programming language by a few C compilers (and I use
the term `C' loosely).  MS-DOS C compilers seem only to accept a subset
of the C language because it allows them to compile certain benchmarks
into faster code.

ajr

--
owotd (rot13): fabgentf




More information about the Comp.lang.c mailing list