fprintf()

Print formatted text to a file. This function works like the C language counterpart. An argument is required for each format code in the format string. Unlike the function fputs(), newline is not automatically appended to the printed text. Returns: none.

See also: sprintf(), fputs().

Syntax:

fprintf(file, fmt, args...);

where

file is the open file handle for the output file.

fmt is the output format string.

args are the values to be included in the formatted output, as required by the format string. The format codes recognized are:

  • %c is the single ASCII character
  • %d is the signed decimal integer
  • %e is the floating point value in scientific format
  • %E is the same as %e but with E in exponent
  • %f is the floating point value in fixed decimal format
  • %g is the floating point value in flexible format, most compact of %e or %f
  • %G is the same as %g but with E printed in exponent instead of e
  • %i is the integer value
  • %o is the octal integer
  • %s is the string value
  • %u is the unsigned integer value
  • %x is the hexadecimal integer, using lower case abcdef
  • %X is the hexadecimal integer, using upper case ABCDEF

Example:

Prints to the standard error stream: The value of x is 5.5.

x=5.5;
fprintf (stderr, "The value of %s is %f\n", "x", x);

Download Example File:

The following link(s) lead to the Agilent EEsof EDA Knowledge center website. You will need to register at this site with a valid support contract to download an example file.

Copy File
Layer/Process Manager

Where Used:

Measurement Expressions (Data Display equations and Schematic MeasEqns), Schematic, Layout, Simulation, GUI

 

Privacy Statement  | Terms of Use  | Legal | Contact Us  | © Agilent 2000-2008 

Contents
Additional Resources