PRINTUSING function for C?

Sean Malloy malloy at nprdc.arpa
Sat Jul 21 03:36:17 AEST 1990


In article <37 at fincomp.UUCP> root at fincomp.UUCP (Superuser) writes:
|I have a situation where some basic software types forms with a statement
|like:

|  call typereal(hp, vp, "$###,###,##.##", realvar);

|where hp and vp are x,y coordinates where the output is to be printed,
|realvar is a double precision real variable, and that mess in the 
|middle is a format specifier used by BASIC's PRINTUSING statement.
|This statement would cause the value of realvar to be printed in a
|dollar and cents format with commas and a floating dollar sign.
|If I had a way to handle the printusing statement in C then I could
|re-use a bunch of existing BASIC code with just a touch of editing.

The latest issue of Dr. Dobb's Journal has an article on writing
routines for handling formatted output like this; I suggest that you
look there first.


                                               | "The three most dangerous
 Sean Malloy                                   | things in the world are a
 Navy Personnel Research & Development Center  | programmer with a soldering
 San Diego, CA 92152-6800                      | iron, a hardware type with a
 malloy at nprdc.navy.mil                         | program patch, and a user
                                               | with an idea."



More information about the Comp.lang.c mailing list