Microchip Technology SW006021-2 Manual De Usuario
Library Functions
2012 Microchip Technology Inc.
DS52053B-page 369
Description
The
strstr()
function locates the first occurrence of the sequence of characters in the
string pointed to by
s2
in the string pointed to by
s1
.
The
stristr()
routine is the case-insensitive version of this function.
Example
#include <stdio.h>
#include <string.h>
void
main (void)
{
printf("%d\n", strstr("This is a string", "str"));
}
Return Value
to the located string or a null if the string was not found.
STRTOD
Synopsis
#include <stdlib.h>
double strtok (const char * s, const char ** res)
Description
Parse the string s converting it to a double floating-point type. This function converts
the first occurrence of a substring of the input that is made up of characters of the
expected form after skipping leading white-space characters. If res is not NULL, it will
be made to point to the first character after the converted sub-string.
the first occurrence of a substring of the input that is made up of characters of the
expected form after skipping leading white-space characters. If res is not NULL, it will
be made to point to the first character after the converted sub-string.
Example
#include <stdio.h>
#include <strlib.h>
void
main (void)
{
char buf[] = "35.7 23.27";
char * end;
double in1, in2;
in1 = strtod(buf, &end);
in2 = strtod(end, NULL);
printf("in comps: %f, %f\n", in1, in2);
}
See Also
atof()
Return Value
Returns a double representing the floating-point value of the converted input string.