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.

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

NAME<br />

memccpy, memchr, memcmp, memcpy, memset - memory operations<br />

SYNOPSIS<br />

#include <br />

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

char •sl, •s2;<br />

int c, n;<br />

char •memchr (s, c, n)<br />

char •s;<br />

int c, n;<br />

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

char •sl, •s2;<br />

int n;<br />

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

char •sl, •s2;<br />

int n;<br />

char •memset (s, c, n)<br />

char •s;<br />

int c, n;<br />

DESCRIPTION<br />

These functions operate efficiently on memory areas (arrays of<br />

characters bounded by a count, not terminated by a null character).<br />

They do not check for the overflow of any receiving memory<br />

area.<br />

Memccpy copies characters from memory area 82 into 81 , stopping<br />

after the first occurrence of character c has been copied, or<br />

after n characters have been copied, whichever comes first. It<br />

returns a pointer to the character after the copy of c in 81 , or a<br />

NULL pointer if c was not found in the first n characters of 82.<br />

Memchr returns a pointer to the first occurrence of character c in<br />

the first n characters of memory area 8, or a NULL pointer if c<br />

does not occur.<br />

Memcmp compares its arguments, looking at the first n characters<br />

only, and returns an integer less than, equal to, or greater than 0,<br />

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

than 82.<br />

Memcpy copies n characters from memory area 82 to 81 . It<br />

returns 81 .<br />

Mem8et sets the first n characters in memory area 8 to the value<br />

of character c. It returns 8 •<br />

NOTE<br />

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

optional header file.<br />

BUGS<br />

Memcmp uses native character comparison, which is signed on<br />

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

- 1 -

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

Saved successfully!

Ooh no, something went wrong!