Mikroc, Strchr, Strcmp – ABL electronic PIC Microcontrollers PIC16 User Manual

Page 305: Strcpy, Strlen

Advertising
background image

MikroElektronika: Development tools - Books - Compilers

297

page

mikroC - C Compiler for Microchip PIC microcontrollers

mikroC

making it simple...

Prototype

char

*strchr(char *s, char c);

Description

Function locates the first occurrence of character

c

in the string

s

. Function returns a

pointer to the

c

, or a null pointer if

c

does not occur in

s

. The terminating null character

is considered to be a part of the string.

strchr

Prototype

char

strcmp(char *s1, char *s2);

Description

Function compares strings

s1

and

s2

, and returns zero if the strings are equal, or returns

a difference between the first differing characters (in a left-to-right evaluation).
Accordingly, the result is greater than zero if

s1

is greater than

s2

, and vice versa.

strcmp

Prototype

char

*strcpy(char *s1, char *s2);

Description

Function copies the string

s2

into the string

s1

. If successful, function returns

s1

. The

strings may not overlap.

strcpy

Prototype

unsigned

strlen(char *s);

Description

Function returns the length of the string

s

(the terminating null character does not count

against string’s length).

strlen

Advertising
This manual is related to the following products: