Function: strarf Purpose: print array of int|long|char|float|double|pointer into a string Category: general C-programs Author: Do Kester Use: char *strarf( char *mess, IN : large enough to contain the formatted array char *fmt, IN : fmt as in printf for ONE element of the array void *pX, IN : the array to be formatted long nr, IN : nr of elements to be formatted long step ) IN : stepsize through the array Returns: pointer to mess Description: It is decided what kind of array pX is by looking at the fmt. This fmt string is very similar to the printf-format, with the exception that it has to discriminate between int and long and between float and double, when those are different. fmt array %i int %u unsigned int %d long %c char %efg float %EG double %p pointer All standard flags and field-width specifiers of C are allowed between the % and the conversion character. The declaration of this function is in "userfio.h" Example: float *array = { 1.0, 2.0, 3.0, 4.0 } ; anyoutf( 0, "array = %s", strarf( mess, "%5.1f", array, 2, 2 ) ); prints array = 1.0 3.0 Comment: This routine is NOT callable in FORTRAN. Updates: 25 Oct 1995: DK, Creation date