SW006014 Microchip Technology, SW006014 Datasheet - Page 88

C COMPILER MPLAB FOR PIC24 MCU

SW006014

Manufacturer Part Number
SW006014
Description
C COMPILER MPLAB FOR PIC24 MCU
Manufacturer
Microchip Technology
Type
MPLAB® C Compilerr
Series
PIC24r
Datasheet

Specifications of SW006014

Supported Families
PIC24
Core Architecture
PIC
Kit Contents
Software And Docs
Mcu Supported Families
PIC24
Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC24
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC24
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
DS51456E-page 84
sscanf (Continued)
Example:
tmpfile
Description:
Include:
Prototype:
Return Value:
Remarks:
Example:
#include <stdio.h> /* for sscanf, printf */
int main(void)
{
}
Output:
Number of items scanned = 4
Favorite number = 5
Favorite letter = T
Favorite color = green
Desired salary = $3000000.00
Creates a temporary file
<stdio.h>
FILE *tmpfile(void)
Returns a stream pointer if successful; otherwise, returns a NULL
pointer.
tmpfile creates a file with a unique filename. The temporary file is
opened in w+b (binary read/write) mode. It will automatically be
removed when exit is called; otherwise the file will remain in the
directory.
#include <stdio.h> /* for tmpfile, printf, */
int main(void)
{
}
Output:
Temporary file was created
char s[] = "5 T green 3000000.00";
int number, items;
char letter;
char color[10];
float salary;
items = sscanf(s, "%d %c %s %f", &number, &letter,
printf("Number of items scanned = %d\n", items);
printf("Favorite number = %d\n", number);
printf("Favorite letter = %c\n", letter);
printf("Favorite color = %s\n", color);
printf("Desired salary = $%.2f\n", salary);
FILE *mytempfile;
if ((mytempfile = tmpfile()) == NULL)
else
printf("Cannot create temporary file");
printf("Temporary file was created");
&color, &salary);
/* FILE, NULL
© 2008 Microchip Technology Inc.
*/

Related parts for SW006014