SW006014 Microchip Technology, SW006014 Datasheet - Page 54

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 50
fclose
Description:
Include:
Prototype:
Argument:
Return Value:
Remarks:
Example:
Close a stream.
<stdio.h>
int fclose(FILE *stream);
stream
Returns 0 if successful; otherwise, returns EOF if any errors were
detected.
fclose writes any buffered output to the file.
#include <stdio.h> /* for fopen, fclose,
int main(void)
{
}
Output:
afile1 was opened
afile1 was closed
FILE *myfile1, *myfile2;
int y;
if ((myfile1 = fopen("afile1", "w+")) == NULL)
else
{
}
printf("Cannot open afile1\n");
printf("afile1 was opened\n");
y = fclose(myfile1);
if (y == EOF)
else
printf("afile1 was not closed\n");
printf("afile1 was closed\n");
pointer to the stream to close
/* printf,FILE, NULL, EOF */
© 2008 Microchip Technology Inc.
*/

Related parts for SW006014