printVf(3)

NAME
printVf, fprintVf, scanVf, fscanVf -- routines for printing and reading single precision vectors.

USAGE
#include <stdio.h>

printVf (fmt, v, size)
   const char *fmt;
   float *v;
   int size;

fprintVf (fp, fmt, v, size)
   FILE *fp;
   const char *fmt;
   float *v;
   int size;

scanVf (v, size)
   float *v;
   int size;

fscanVf (fp, v, size)
   FILE *fp;
   float *v;
   int size;

ARGUMENTS

v --
    Vector to be printed.

size --
    Size of the vector.

fp --
    Pointer to file buffer.

fmt --
    "printf" style format string.

RESTRICTIONS
These routines must be called from the planning level. rciPrintVf() can be used for the control level.

DESCRIPTION
These routines provide a convenient interface for reading and writing vectors.

printVf() prints a vector on stdout. The format string is a printf() style format string, which is assumed to contain only one definition (see printf(3)). This defines the format with which all the numbers in the vector will be printed, with an additional space automatically being inserted between each number. Material in the format string prior to and following the definition is printed verbatim, prior to and following the vector information.

For example,
   printVf("before: 5.2f after:, v, 4);

would print:
   before: 34.12  0.00  1.23 -4.50 after:

(assuming v contains those numbers).

fprintVf() is identical to printVf() except that the output is routed to the indicated stream.

scanVf() reads a vector in from stdin. The vector is read using the f format of scanf(3).

fscanVf() is identical to scanVf() except that its input is obtained from the indicated stream.

DIAGNOSTICS
The scanVf functions return 1 if successful, 0 if the read failed, or EOF if an end-of-file was encountered.

Calling these routines from the control level will cause the program to crash.

SEE ALSO
copyV(3), addVf(3), addVd(3), printVd(3)