SW006014 Microchip Technology, SW006014 Datasheet - Page 137

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
© 2008 Microchip Technology Inc.
strrchr (Continued)
strspn
Description:
Include:
Prototype:
Arguments:
Return Value:
Remarks:
Example:
if (ptr != NULL)
}
Output:
buf1 : What time is it?
m found at position 8
y not found
Calculate the number of consecutive characters at the beginning of a
string that are contained in a set of characters.
<string.h>
size_t strspn(const char *s1, const char *s2);
s1
s2
Returns the number of consecutive characters from the beginning of s1
that are contained in s2.
This function stops searching when a character from s1 is not in s2.
#include <string.h> /* for strspn */
#include <stdio.h>
int main(void)
{
}
printf("\n");
ptr = strrchr(buf1, ch2);
{
}
else
char str1[20] = "animal";
char str2[20] = "aeiounm";
char str3[20] = "aimnl";
char str4[20] = "xyz";
int res;
res = strspn(str1, str2);
printf("strspn(\"%s\", \"%s\") = %d\n",
res = strspn(str1, str3);
printf("strspn(\"%s\", \"%s\") = %d\n",
res = strspn(str1, str4);
printf("strspn(\"%s\", \"%s\") = %d\n",
res = ptr - buf1 + 1;
printf("%c found at position %d\n", ch2, res);
printf("%c not found\n", ch2);
str1, str2, res);
str1, str3, res);
str1, str4, res);
pointer to the string to be searched
pointer to characters to search for
/* for printf */
DS51456E-page 133

Related parts for SW006014