/* stampa matrice di double, con formattazione di printf passata come argomento (vedi prova_sprintf.c) */ #include #include #define NR 3 #define NC 4 //--------------------------------------------- float drunif(double min, double max) { float rzerouno; if(min >= max) return(0); rzerouno = (double) rand() / (double) RAND_MAX; return( min + rzerouno * (max-min) ); } //-------------------------------------------------------------------- void stampaMatriceDfmt(int nr, int nc, double A[nr][nc], char ftm[]) { int i, j; char formato[20]; sprintf(formato, "%%%s ", ftm); printf("Formato: %s\n", formato); for(i=0; i