/**///// //! Check if a particular filename has to be used for the file where the result //! is stored //! @param argc number of command line arguments (from main(argc, argv) //! @param argv pointers to command line arguments (from main(argc, argv) //! @param filename filename of result file, updated if user specified //! filename /**///// void getResultFilename( int argc, char** argv, char*& filename) ...{ char* temp = NULL; cutGetCmdLineArgumentstr( argc, (constchar**) argv, "filename-result", &temp); if( NULL != temp) ...{ filename = (char*) malloc( sizeof(char) * strlen( temp)); strcpy( filename, temp); cutFree( temp); } printf( "Result filename: '%s' ", filename); }
类似的:
/**///// //! Check if a specific precision of the eigenvalue has to be obtained //! @param argc number of command line arguments (from main(argc, argv) //! @param argv pointers to command line arguments (from main(argc, argv) //! @param iters_timing numbers of iterations for timing, updated if a //! specific number is specified on the command line /**///// void getPrecision( int argc, char** argv, float& precision) ...{ float temp =-1.0f; cutGetCmdLineArgumentf( argc, (constchar**) argv, "precision", &temp); if( temp >0.0f) ...{ precision = temp; } printf( "Precision: %f ", precision); }