SW006013 Microchip Technology, SW006013 Datasheet - Page 62

MPLAB C Compiler For DsPIC DSCs

SW006013

Manufacturer Part Number
SW006013
Description
MPLAB C Compiler For DsPIC DSCs
Manufacturer
Microchip Technology
Series
DsPIC30F/33Fr
Type
MPLAB® C Compilerr
Datasheet

Specifications of SW006013

Supported Families
DsPIC30F, DsPIC33F
Core Architecture
DsPIC
Kit Contents
Software And Docs
Mcu Supported Families
DsPIC30F And DsPIC33F
Tool Function
Compiler
Tool Type
Compiler
Processor Series
dsPIC
Lead Free Status / RoHS Status
na
For Use With/related Products
dSPIC DSCs
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
DS51456E-page 58
fprintf
Description:
Include:
Prototype:
Arguments:
Return Value:
Remarks:
Example:
Prints formatted data to a stream.
<stdio.h>
int fprintf(FILE *stream, const char *format, ...);
stream
format
...
Returns number of characters generated or a negative number if an
error occurs.
The format argument has the same syntax and use that it has in
print.
#include <stdio.h> /* for fopen, fclose, */
int main(void)
{
}
Output:
Number of characters printed to file = 25
Contents of afile:
Print this string 1 time
FILE *myfile;
int y;
char s[]="Print this string";
int x = 1;
char a = '\n';
if ((myfile = fopen("afile", "w")) == NULL)
else
{
}
printf("Cannot open afile\n");
y = fprintf(myfile, "%s %d time%c", s, x, a);
printf("Number of characters printed "
fclose(myfile);
"to file = %d",y);
pointer to the stream in which to output data
format control string
optional arguments
/* fprintf, printf,
/* FILE, NULL
© 2008 Microchip Technology Inc.
*/
*/

Related parts for SW006013