Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!utnut!cs.utexas.edu!uunet!decwrl!decwrl!csus.edu!sfsuvax1.sfsu.edu!vpcsc4
From: vpcsc4@sfsuvax1.sfsu.edu (Emmett McLean)
Subject: C arrays, J structs, and LinkJ
Message-ID: <1993May2.065705.22306@csus.edu>
Sender: news@csus.edu
Organization: San Francisco State University
Date: Sun, 2 May 1993 06:57:05 GMT
Lines: 22


One of the difficulties I've run into when porting programs to
10!:k is that often the original usage of the C program uses
multidimensional array declarations such as "int d[10][10]"
which assumes that the number of columns (and rows) are known 
at compile time. I would like to know if arrays of the type
int[][] can be allocated memory dynamically. Also I would like to
know if it is possible to cast C arrays into the AV portion
of A structs. (I've been using bcopy to transfer data back
and forth which seems inefficient.)

PS. To get around this I'll created the following macro :

#define index(y,i,j) *((D*)(AV(y)+CHAR*((i*(AS(y)[1]))+j)))

which allows a reference such as "a[i][j]" to become "index(a,i,j)" .

But this requires major alterations of the original program.

Thanks,

Emmett
