Datasheet

memchr
memcmp
memcpy
memmove
memset
555
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
void *memchr(void *p, char n, unsigned int v);
Description
Function locates the first occurrence of n in the initial v bytes of memory area
starting at the address p. The function returns the pointer to this location or 0 if
the n was not found.
For parameter p you can use either a numerical value (literal/variable/constant)
indicating memory address or a dereferenced value of an object, for example
&mystring or &P0.
Prototype
int memcmp(void *s1, void *s2, int n);
Description
Function compares the first n characters of objects pointed to by s1 and s2 and
returns zero if the objects are equal, or returns a difference between the first dif-
fering characters (in a left-to-right evaluation). Accordingly, the result is greater
than zero if the object pointed to by s1 is greater than the object pointed to by
s2 and vice versa.
Prototype
void *memcpy(void *d1, void *s1, int n);
Description
Function copies n characters from the object pointed to by s2 into the object point-
ed to by d1. If copying takes place between objects that overlap, the behavior is
undefined. The function returns address of the object pointed to by d1.
Prototype
void *memmove(void *to, void *from, register int n);
Description
Function copies n characters from the object pointed to by from into the object
pointed to by to. Unlike memcpy, the memory areas to and from may overlap.
The function returns address of the object pointed to by to.
Prototype
void *memset(void *p1, char character, int n)
Description
Function copies the value of the character into each of the first n characters of
the object pointed by p1. The function returns address of the object pointed to
by
p1.