general input/output routines

SYNOPSIS

#include 
#include "matrix.h"
int   finput(FILE *fp, char *prompt, char *fmt, void *var)
int   input(char *prompt, char *fmt, void *var)
int   fprompter(FILE *fp, char *prompt)
int   prompter(char *prompt)

DESCRIPTION

The macros finput() and input() are for general input, allowing for comments as accepted by the .._finput() routines. That is, if input is from a file, then comments (text following a `\#' until the end of the line) are skipped, and if input is from a terminal, then the string prompt is printed to stderr. The input is read for the file/stream fp by finput() and by stdin by input(). The fmt argument is a string containing the scanf() format, and var is the argument expected by scanf() according to the format string fmt. For example, to read in a file name of no more than 30 characters from stdin, use

char  fname[31];
  ......
input("Input file name: ","
The macros fprompter() and prompter() send the {\tt prompt} string to stderr if the input file/stream (fp in the case of fprompter(), stdin for prompter()) is a terminal; otherwise any comments are skipped over.

SEE ALSO: scanf(), .._finput()

SOURCE FILE: matrix.h