Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual

Product codes
SW006021-1
Page of 518
Library Functions
 2012 Microchip Technology Inc.
DS52053B-page 339
See Also
toupper()
, tolower(), toascii()
ISDIG 
Synopsis
#include <ctype.h>
 
int isdig (int c)
Description
The 
isdig
() function tests the input character c to see if is a decimal digit (0 – 9) and 
returns true is this is the case; false otherwise.
Example
#include <ctype.h>
void
main (void)
{
    char buf[] = "1998a";
    if(isdig(buf[0]))
        printf(" type detected\n");
}
See Also
isdigit()
 (listed under isalnum())
Return Value
Zero if the character is a decimal digit; a non-zero value otherwise.
ITOA 
Synopsis
#include <stdlib.h>
 
char * itoa (char * buf, int val, int base)
Description
The function 
itoa
 converts the contents of 
val
 into a string which is stored into 
buf
The conversion is performed according to the radix specified in 
base
buf
 is assumed 
to reference a buffer which has sufficient space allocated to it.
Example
#include <stdlib.h>
#include <stdio.h>
void
main (void)
{
    char buf[10];
    itoa(buf, 1234, 16);
    printf("The buffer holds %s\n", buf);
}
See Also
strtol()
, utoa(), ltoa(), ultoa()