SW006013 Microchip Technology, SW006013 Datasheet - Page 67

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
© 2008 Microchip Technology Inc.
fscanf (Continued)
Prototype:
Arguments:
Return Value:
Remarks:
Example:
int fscanf(FILE *stream, const char *format, ...);
stream
format
...
Returns the number of items successfully converted and assigned. If
no items are assigned, a 0 is returned. EOF is returned if end-of-file is
encountered before the first conversion or if an error occurs.
The format argument has the same syntax and use that it has in
scanf.
#include <stdio.h> /* for fopen, fscanf,
int main(void)
{
}
Input:
Contents of afile:
Print this string 100 times
Output:
Print
this
string
100
times
FILE *myfile;
char s[30];
int x;
char a;
if ((myfile = fopen("afile", "w+")) == NULL)
else
{
}
printf("Cannot open afile\n");
fprintf(myfile, "%s %d times%c",
fseek(myfile, 0L, SEEK_SET);
fscanf(myfile, "%s", s);
printf("%s\n", s);
fscanf(myfile, "%s", s);
printf("%s\n", s);
fscanf(myfile, "%s", s);
printf("%s\n", s);
fscanf(myfile, "%d", &x);
printf("%d\n", x);
fscanf(myfile, "%s", s);
printf("%s\n", s);
fscanf(myfile, "%c", a);
printf("%c\n", a);
fclose(myfile);
pointer to the open stream from which to read data
format control string
optional arguments
"Print this string", 100, '\n');
/* fclose, fprintf,
/* fseek, printf, FILE, */
/* NULL, SEEK_SET
DS51456E-page 63
*/
*/
*/

Related parts for SW006013