SW006014 Microchip Technology, SW006014 Datasheet - Page 96

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 92
abs
Description:
Include:
Prototype:
Argument:
Return Value:
Remarks:
Example:
atexit
Description:
Include:
Prototype:
Argument:
Return Value:
Remarks:
Example:
Calculates the absolute value.
<stdlib.h>
int abs(int i);
i
Returns the absolute value of i.
A negative number is returned as positive; a positive number is
unchanged.
#include <stdio.h>
#include <stdlib.h> /* for abs
int main(void)
{
}
Output:
The absolute value of
The absolute value of
The absolute value of
Registers the specified function to be called when the program termi-
nates normally.
<stdlib.h>
int atexit(void(*func)(void));
func
Returns a zero if successful; otherwise, returns a non-zero value.
For the registered functions to be called, the program must terminate
with the exit function call.
#include <stdio.h>
#include <stdlib.h> /* for atexit, exit
void good_msg(void);
void bad_msg(void);
void end_msg(void);
int i;
i = 12;
printf("The absolute value of
i = -2;
printf("The absolute value of
i = 0;
printf("The absolute value of
i, abs(i));
i, abs(i));
i, abs(i));
integer value
function to be called
/* for printf */
/* for scanf, printf */
12 is
-2 is
0 is
12
© 2008 Microchip Technology Inc.
2
0
%d is
%d is
*/
%d is
%d\n",
%d\n",
*/
%d\n",

Related parts for SW006014