home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!math.fu-berlin.de!informatik.tu-muenchen.de!backscha
- From: backscha@Informatik.TU-Muenchen.DE (Martin Backschat)
- Subject: Accessing a dynamical 3-D field
- Originator: backscha@hpzenger1.informatik.tu-muenchen.de
- Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
- Organization: Technische Universitaet Muenchen, Germany
- Date: Tue, 29 Dec 1992 14:21:34 GMT
- Message-ID: <1992Dec29.142134.25641@Informatik.TU-Muenchen.DE>
- Lines: 13
-
-
- In my program I use 3-D fields of doubles with variable bounds.
- This field is implemented as an array of doubles which is allocated
- dynamically with malloc.
- To access for example the [i][j][k] component in the field f of dimension U,V,W
- I have to write f[i*V*W + j*W + k].
-
- Now my question:
-
- Is it somehow possible to declare and allocate a 3-D field u (of doubles) with
- variable bounds, allocated by malloc, in such a way that it can be accessed
- with
- u[i,j,k] (with type casting)?
-