Strchr, Strcmp, Strchr strcmp – Zilog EZ80F916 User Manual

Page 385

Advertising
background image

UM014423-0607

C Standard Library

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

365

Synopsis

#include <string.h>
char *strcat(char *s1, char *s2);

Returns

The value of s1.

Example

char *ptr;
char s1[80]="Production";
char s2[]="Languages";
ptr=strcat(s1,s2);

strchr

Locates the first occurrence of c (converted to a

char

) in the string pointed to by s. The

terminating null character is considered to be part of the string.

Synopsis

#include <string.h>
char *strchr(char *s, int c);

Returns

A pointer to the located character or a null pointer if the character does not occur in the
string.

Example

char *ptr;
char str[]="COMPASS";
ptr=strchr(str,'p');

strcmp

Compares the string pointed to by s1 to the string pointed to by s2.

Synopsis

#include <string.h>
int strcmp(char *s1, char *s2);

Returns

An integer greater than, equal to, or less than zero, according as the string pointed to by s1
is greater than, equal to, or less than the string pointed to by s2.

Advertising
This manual is related to the following products: