Programming Challenge

Charles Noren noren at dinl.uucp
Wed Dec 19 06:15:56 AEST 1990


In article <MAGUIRE.90Dec17132020 at sun.clarkson.edu> maguire at sun.soe.clarkson.edu (Bill Maguire) writes:
 >In article <1990Dec15.015355.15683 at fmrco> harold at fmrco (Harold Naparst) writes:
 >
 >>I am trying to write a function which will return the index
 >>of the smallest element of an array.  I want the routine
 >>to work for any type array.  That is, I don't want to write
 >>a separate routine for each type of array (real or double or
 >>integer).  How can I do this ?  I tried playing around with 
 >>the GNU C typeof operator, but couldn't figure it out.  Any ideas ?
 >
 >>Harold Naparst
 >
 >Two ways immediately pop to mind:

...or you could wait until AT&T implements Parameterized Types,
or use (AT YOUR OWN RISK) one of the C++ compilers that has a version
Parameterized Types (e.g., the C++ that comes with ObjectStore OODBMS
by Object Design, Inc).


-- 
Chuck Noren
NET:     dinl!noren at ncar.ucar.edu
US-MAIL: Martin Marietta I&CS, MS XL8058, P.O. Box 1260,
         Denver, CO 80201-1260
Phone:   (303) 971-7930



More information about the Comp.lang.c mailing list