01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

STRING ( 3C ) STRING (3C)<br />

NAME strcat, strncat, strcmp, strncmp, strcpy, strncpy, strlen, strchr,<br />

strrchr, strpbrk, strspn, strcspn, strtok - string operations<br />

SYNOPSIS<br />

#include <br />

char •strcat (sl, s2)<br />

char •sl, •s2;<br />

char •strncat (sl, s2, n)<br />

char •sl, •s2;<br />

int n;<br />

int strcmp (sl, s2)<br />

char *sl, •s2;<br />

int strncmp (sl, s2, n)<br />

char •sl, •s2;<br />

int n;<br />

char •strcpy (sl, s2)<br />

char •sl, •s2;<br />

char •strncpy (sl, s2, n)<br />

char •sl, •s2;<br />

int n;<br />

int strlen (s)<br />

char •s;<br />

char •strchr (s, c)<br />

char •s, c;<br />

char •strrchr (s, c)<br />

char •s, c;<br />

char •strpbrk (sl, s2)<br />

char •sl, *s2;<br />

int strspn (sl, s2)<br />

char •sl, •s2;<br />

int strcspn (sl, s2)<br />

char •sl, •s2;<br />

char •strtok (sl, s2)<br />

char •sl, •s2;<br />

DESCRIPTION<br />

The arguments 81, 82 and 8 point to strings (arrays of characters<br />

terminated by a null character). The functions 8trcat, 8trncat,<br />

8trcpy and 8trncpy all alter 81 . These functions do not check for<br />

overflow of the array pointed to by 81 .<br />

Strcat appends a copy of string 82 to the end of string 81 .<br />

Strncat appends at most n characters. Each returns a pointer to<br />

the null-terminated result.<br />

Strcmp compares its arguments and returns an integer less than,<br />

equal to, or greater than 0, according as s1 is lexicographically less<br />

than, equal to, or greater than s2. Strncmp makes the same comparison<br />

but looks at n characters at most.<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!