SW006014 Microchip Technology, SW006014 Datasheet - Page 136

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 132
strpbrk (Continued)
strrchr
Description:
Include:
Prototype:
Arguments:
Return Value:
Remarks:
Example:
if (ptr != NULL)
}
Output:
strpbrk("What time is it?", "xyz")
match not found
strpbrk("What time is it?", "eou?")
match found at position 9
Search for the last occurrence of a specified character in a string.
<string.h>
char *strrchr(const char *s, int c);
s
c
Returns a pointer to the character if found; otherwise, returns a null
pointer.
The function searches the string s, including the terminating null
character, to find the last occurrence of character c.
#include <string.h> /* for strrchr, NULL */
#include <stdio.h>
int main(void)
{
if (ptr != NULL)
printf("\n");
printf("strpbrk(\"%s\", \"%s\")\n", str1, str3);
ptr = strpbrk(str1, str3);
{
}
else
char buf1[50] = "What time is it?";
char ch1 = 'm', ch2 = 'y';
char *ptr;
int res;
printf("buf1 : %s\n\n", buf1);
ptr = strrchr(buf1, ch1);
{
}
else
res = ptr - str1 + 1;
printf("match found at position %d\n", res);
printf("match not found\n");
res = ptr - buf1 + 1;
printf("%c found at position %d\n", ch1, res);
printf("%c not found\n", ch1);
pointer to the string to be searched
character to search for
/* for printf
© 2008 Microchip Technology Inc.
*/

Related parts for SW006014