Microchip Technology SW006021-1N 사용자 설명서
MPLAB
®
XC8 C Compiler User’s Guide
DS52053B-page 344
2012 Microchip Technology Inc.
Note
The function which called setjmp() must still be active when
longjmp()
is called.
Breach of this rule will cause disaster, due to the use of a stack containing invalid data.
LTOA
Synopsis
#include <stdlib.h>
char * ltoa (char * buf, long val, int base)
Description
The function
ltoa
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];
ltoa(buf, 12345678L, 16);
printf("The buffer holds %s\n", buf);
}
See Also
strtol()
, itoa(), utoa(), ultoa()
Return Value
This routine returns a copy of the buffer into which the result is written.
MEMCHR
Synopsis
#include <string.h>
void * memchr (const void * block, int val, size_t length)
Description
The
memchr()
function is similar to strchr() except that instead of searching null-ter-
minated strings, it searches a block of memory specified by length for a particular byte.
Its arguments are a pointer to the memory to be searched, the value of the byte to be
searched for, and the length of the block. A pointer to the first occurrence of that byte
in the block is returned.
Its arguments are a pointer to the memory to be searched, the value of the byte to be
searched for, and the length of the block. A pointer to the first occurrence of that byte
in the block is returned.