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 >
C/C++ Source or Header  |  1993-05-22  |  813b  |  31 lines

  1. /* DYN2DARR.H */
  2.  
  3. /*  Copyright 1993 by P. J. LaBrocca
  4.     All rights reserved.
  5.  
  6.     Use with Microsoft C versions 6, 7 & 8 (MS-DOS)
  7.     and Symantec THINK C 5 (Macintosh).
  8. */
  9.  
  10. #ifndef DYN2DARR
  11. #define DYN2DARR
  12.  
  13. #include <stdlib.h>  /* for free() */
  14.  
  15. #define Dyn2dArray(r,c,t) (dyn2darray((unsigned) (r), \
  16.                                 (unsigned) (c), sizeof(t) ))
  17. #define Dyn2dRows(A) (*((unsigned *) A[0] - 2))
  18. #define Dyn2dCols(A) (*((unsigned *) A[0] - 1))
  19.  
  20. #if 0
  21. /* Might not be what you need. */
  22. #define Dyn2dSizeOf(A) ( (*((unsigned *) A[0] - 2)) * \
  23.                          (*((unsigned *) A[0] - 1)) * \
  24.                          sizeof( **A ) )
  25. #endif
  26.  
  27. /* Prototype */
  28. void **dyn2darray( unsigned row, unsigned col, unsigned el_size );
  29.  
  30. #endif DYN2DARR
  31. /* End of File */