beautypg.com

Strcat, Strchr, Strcat strchr – Zilog ZUSBOPTS User Manual

Page 471: Returns, Example, Synopsis

background image

UM017105-0511

Standard Functions

Zilog Developer Studio II – ZNEO™

User Manual

443

Returns

The value of the macro EOF if an input failure occurs before any conversion. Otherwise,
the

sscanf

function returns the number of input items assigned, which can be fewer than

provided for, or even zero, in the event of an early conflict between an input character and
the format.

Example

char buf [80];

int i;

sscanf(buf,"%d",&i);

strcat

Appends a copy of the string pointed to by s2 (including the terminating null character) to
the end of the string pointed to by s1. The initial character of s2 overwrites the null charac-
ter at the end of s1.

Synopsis

#include

char *strcat(char *s1, const 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

char *strchr(const char *s, int c);

This manual is related to the following products: