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 />

NOTE<br />

BUGS<br />

Strcpy copies string 82 to 81 , stopping after the null character has<br />

been copied. Strncpy copies exactly n characters, truncating 82<br />

or adding null characters to 81 if necessary. The result will not be<br />

null-terminated if the length of 82 is n or more. Each function<br />

returns 81 .<br />

Strlen returns the number of characters in 8, not including the<br />

terminating null character.<br />

Strchr ( 8trrchr) returns a pointer to the first (last) occurrence of<br />

character c in string 8, or a NULL pointer if c does not occur in<br />

the string. The null character terminating a string is considered<br />

to be part of the string.<br />

Strpbrk returns a pointer to the first occurrence in string 81 of<br />

any character from string 82, or a NULL pointer if no character<br />

from 82 exists in 81 .<br />

Str8pn ( 8trc8pn) returns the length of the initial segment of string<br />

81 which consists entirely of characters from (not from) string 82.<br />

Strtok considers the string 81 to consist of a sequence of zero or<br />

more text tokens separated by spans of one or more characters<br />

from the separator string 82. The first call (with pointer 81<br />

specified) returns a pointer to the first character of the first token,<br />

and will have written a null character into 81 immediately following<br />

the returned token. The function keeps track of its position in<br />

the string between separate calls, so that on subsequent calls<br />

(which must be made with the first argument a NULL pointer) will l<br />

work through the string 81 immediately following that token. In<br />

this way subsequent calls will work through the string 81 until no<br />

tokens remain. The separator string 82 may be different from call<br />

to call. When no token remains in 81, a NULL pointer is returned.<br />

For user convenience, all these functions are declared in the<br />

optional header file.<br />

Strcmp and 8trncmp use native character comparison, which is<br />

signed on PDP- lis, unsigned on other machines.<br />

Character movement is performed differently in different implementations.<br />

Thus overlapping moves may yield surprises.<br />

- 2 -

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

Saved successfully!

Ooh no, something went wrong!