SW006014 Microchip Technology, SW006014 Datasheet - Page 104

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 100
div (Continued)
exit
Description:
Include:
Prototype:
Argument:
Remarks:
Example:
Output:
For div(7, 3)
The quotient is 2 and the remainder is 1
For div(7, -3)
The quotient is -2 and the remainder is 1
For div(-5, 3)
The quotient is -1 and the remainder is -2
For div(7, 7)
The quotient is 1 and the remainder is 0
For div(7, 0)
Illegal instruction executed
ABRT
Terminates program after clean up.
<stdlib.h>
void exit(int status);
status
exit calls any functions registered by atexit in reverse order of reg-
istration, flushes buffers, closes stream, closes any temporary files
created with tmpfile, and resets the processor. This function is
customizable. See pic30-libs.
#include <stdio.h>
#include <stdlib.h> /* for exit
int main(void)
{
}
Output:
Cannot open samp.fil
FILE *myfile;
if ((myfile = fopen("samp.fil", "r" )) == NULL)
{
}
else
{
}
printf("This will not be printed");
printf("Cannot open samp.fil\n");
exit(EXIT_FAILURE);
printf("Success opening samp.fil\n");
exit(EXIT_SUCCESS);
exit status
/* for fopen, printf, */
/* FILE, NULL
© 2008 Microchip Technology Inc.
*/
*/

Related parts for SW006014