-

Difference between revisions of "Functions HI-TECH C MEMSET"

From HI-TECH C for CP/M Fan WIKI(EN)
Jump to: navigation, search
(Created page with "<strong>MEMSET, MEMCPY, MEMCMP, MEMMOVE</strong> ==SYNOPSIS== #include <string.h> void memset(void s, char c, size_t n) void * memcpy(void * d, void * s, size_t...")
 
Line 1: Line 1:
<strong>MEMSET, MEMCPY, MEMCMP, MEMMOVE</strong>
+
<strong>MEMSET, MEMCPY, MEMCMP, MEMMOVE,MEMCHR</strong>
 
==SYNOPSIS==
 
==SYNOPSIS==
  
Line 29: Line 29:
  
 
strncpy, strncmp, strchr
 
strncpy, strncmp, strchr
 +
 +
==NOTE from editor
 +
 +
MEMCHR is lacked in original manual text as a function name and corrected in this WIKI.

Revision as of 02:01, 1 August 2017

MEMSET, MEMCPY, MEMCMP, MEMMOVE,MEMCHR

SYNOPSIS

#include  <string.h>

void      memset(void s, char c, size_t n)
void *    memcpy(void * d, void * s, size_t n)
int memcmp(void * s1, void * s2, size_t n)
void *    memmove(void * s1, void * s2, size_t n)
void *    memchr(void * s, int c, size_t n)


DESCRIPTION

Memset() initializes n bytes of memory starting at the location pointed to by s with the character c. Memcpy() copies n bytes of memory starting from the location pointed to by s to the block of memory pointed to by d. The result of copying overlapping blocks is undefined. Memcmp() compares two blocks of memory, of length n, and returns a signed value similar to strncmp(). Unlike strncmp() the comparision does not stop on a null character. The ascii collating sequence is used for the comparision, but the effect of including non-ascii characters in the memory blocks on the sense of the return value is indeterminate. Memmove() is similar to memcpy() except copying of overlapping blocks is handled correctly. The memchr() function locates the first occurence of c (converted to unsigned char) in the initial n characters of the object pointed to by s.

SEE ALSO

strncpy, strncmp, strchr

==NOTE from editor

MEMCHR is lacked in original manual text as a function name and corrected in this WIKI.