home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_11_11
/
labrocca
/
dyn2darr.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-22
|
813b
|
31 lines
/* DYN2DARR.H */
/* Copyright 1993 by P. J. LaBrocca
All rights reserved.
Use with Microsoft C versions 6, 7 & 8 (MS-DOS)
and Symantec THINK C 5 (Macintosh).
*/
#ifndef DYN2DARR
#define DYN2DARR
#include <stdlib.h> /* for free() */
#define Dyn2dArray(r,c,t) (dyn2darray((unsigned) (r), \
(unsigned) (c), sizeof(t) ))
#define Dyn2dRows(A) (*((unsigned *) A[0] - 2))
#define Dyn2dCols(A) (*((unsigned *) A[0] - 1))
#if 0
/* Might not be what you need. */
#define Dyn2dSizeOf(A) ( (*((unsigned *) A[0] - 2)) * \
(*((unsigned *) A[0] - 1)) * \
sizeof( **A ) )
#endif
/* Prototype */
void **dyn2darray( unsigned row, unsigned col, unsigned el_size );
#endif DYN2DARR
/* End of File */