home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!mips!mips!munnari.oz.au!comp.vuw.ac.nz!waikato.ac.nz!mcg
- From: mcg@waikato.ac.nz
- Newsgroups: comp.sys.acorn
- Subject: Passing N-dim array to a function in C?
- Message-ID: <1992Jul21.173107.9517@waikato.ac.nz>
- Date: 21 Jul 92 17:31:07 +1200
- Organization: University of Waikato, Hamilton, New Zealand
- Lines: 39
-
- A question for those C moguls out there:-
-
- One can declare a function
-
- void matrix (double *m)
- {
- blah
- }
-
- and pass it an array declared : double t[10];
-
- matrix(t);
-
-
- What is the data_type declaration that's necessary for an array of an array?
-
- viz
-
- void matrix(????)
- { double *p = malloc(sizeof (m));
- m[1,4] = 1.0123;
- p[3,9] = 1.20394;
- ..}
-
- for declaration of : double t[10][10];
-
- From Martin Glanvill (mcg@waikato.ac.nz)
-
- Dept. Maths @@@@@/|@
- University of Waikato @@@@/ |@
- Hamilton @@@/__|@
- New Zealand @@/ |@
- @@@@@@@@
-
- ----------------****=====| A quote to make your day |======****-----------------
- If a jury in a criminal trial stays out for more than twenty-four hours, it is
- certain to vote acquittal, save in those instances where it votes guilty.
- -- Joseph C. Goulden
- -------------------------------------------------------------------------------
-