SW006014 Microchip Technology, SW006014 Datasheet - Page 140

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 136
strtok (Continued)
Example:
strxfrm
Description:
Include:
Prototype:
Arguments:
Return Value:
Remarks:
#include <string.h> /* for strtok, NULL */
#include <stdio.h> / * for printf
int main(void)
{
}
Output:
str1 : Here, on top of the world!
word 1: Here
word 2: on
word 3: top
word 4: of
word 5: the
word 6: world!
Transforms a string using the locale-dependent rules. (See Remarks.)
<string.h>
size_t strxfrm(char *s1, const char *s2, size_t n);
s1
s2
n
Returns the length of the transformed string not including the terminat-
ing null character. If n is zero, the string is not transformed (s1 may be
a point null in this case) and the length of s2 is returned.
If the return value is greater than or equal to n, the content of s1 is
indeterminate. Since the 16-bit compiler does not support alternate
locales, the transformation is equivalent to strcpy, except that the
length of the destination string is bounded by n-1.
char str1[30] = "Here, on top of the world!";
char delim[5] = ", .";
char *word;
int x;
printf("str1 : %s\n", str1);
x = 1;
word = strtok(str1,delim);
while (word != NULL)
{
}
printf("word %d: %s\n", x++, word);
word = strtok(NULL, delim);
destination string
source string to be transformed
number of characters to transform
© 2008 Microchip Technology Inc.
*/

Related parts for SW006014