//---------------------------------------------------------------- // trydet.cpp // // This program calls an external function to compute the // determinant of a 2x2 array of floating-point values. // // compile using: g++ trydet.cpp det.o -o trydet // // programmer: ALLAN CRUSE // written on: 04 DEC 2003 //---------------------------------------------------------------- #include extern "C" float det( float, float, float, float ); int main( void ) { float a = 2.0, b = 3.0, c = 4.0, d = 5.0; float result = det( a, b, c, d ); printf( "\ndeterminant( %f, %f, %f, %f ) = %f \n\n", a, b, c, d, result ); }