RAD Studio
ContentsIndex
PreviousUpNext
mem.h

The following functions, macros, and classes are provided in mem.h:

Name 
Description 
Header File
mem.h, string.h
Category
Memory and String Manipulation Routines
Prototype
void *memccpy(void *dest, const void *src, int c, size_t n);
Description
Copies a block of n bytes.
memccpy is available on UNIX System V systems.
memccpy copies a block of n bytes from src to dest. The copying stops as soon as either of the following occurs:
  • The character c is first copied into dest.
  • n bytes have been copied into dest.
Return Value
memccpy returns a pointer to the byte in dest immediately following c, if c was copied; otherwise, memccpy returns NULL.
Example  
Header File
mem.h, string.h
Category
Memory and String Manipulation Routines, Inline Routines, C++ Prototyped Routines
Prototype
void *memchr(const void s, int c, size_t n);/ C only */
const void *memchr(const void *s, int c, size_t n);// C++ only
void *memchr(void *s, int c, size_t n);// C++ only
void *memchr(const void s, int c, size_t n);/ C and C++ */
void * _wmemchr(void s, int c, size_t n);/ unicode version */
Description
Searches n bytes for character c.
memchr is available on UNIX System V systems.
memchr searches the first n bytes of the block pointed to by s for character... more 
Header File
mem.h, string.h
Category
Memory and String Manipulation Routines, Inline Routines
Prototype
int memcmp(const void *s1, const void *s2, size_t n);
Description
Compares two blocks for a length of exactly n bytes.
memcmp is available on UNIX System V systems.
memcmp compares the first n bytes of the blocks s1 and s2 as unsigned chars.
Return Value
Because it compares bytes as unsigned chars, memcmp returns a value that is
  • < 0 if s1 is less than s2
  • = 0 if s1 is the same as s2
  • > 0 if s1 is greater than s2
For example,... more 
Header File
mem.h, string.h
Category
Memory and String Manipulation Routines, Inline Routines
Prototype
void *memcpy(void *dest, const void *src, size_t n);
void *_wmemcpy(void *dest, const void *src, size_t n);
Description
Copies a block of n bytes.
memcpy is available on UNIX System V systems.
memcpy copies a block of n bytes from src to dest. If src and dest overlap, the behavior of memcpy is undefined.
Return Value
memcpy returns dest.
Example  
Header File
mem.h, string.h
Category
Memory and String Manipulation Routines
Prototype
int memicmp(const void *s1, const void *s2, size_t n);
Description
Compares n bytes of two character arrays, ignoring case.
memicmp is available on UNIX System V systems.
memicmp compares the first n bytes of the blocks s1 and s2, ignoring character case (upper or lower).
Return Value
memicmp returns a value that is
  • < 0 if s1 is less than s2
  • = 0 if s1 is the same as s2
  • > 0 if s1 is greater than s2
Example  
Header File
mem.h, string.h
Category
Memory and String Manipulation Routines
Prototype
void *memmove(void *dest, const void *src, size_t n);
Description
Copies a block of n bytes.
memmove copies a block of n bytes from src to dest. Even when the source and destination blocks overlap, bytes in the overlapping locations are copied correctly.
Return Value
memmove returns dest.
Example  
Header File
mem.h, string.h
Category
Memory and String Manipulation Routines, Inline Routines
Prototype
void *memset(void *s, int c, size_t n);
void *_wmemset(void *s, int c, size_t n);
Description
Sets n bytes of a block of memory to byte c.
memset sets the first n bytes of the array s to the character c.
Return Value
memset returns s.
Example  
Header File
mem.h
Category
Memory and String Manipulation Routines
Prototype
void setmem(void *dest, unsigned length, char value);
Description
Assigns a value to a range of memory.
setmem sets a block of length bytes, pointed to by dest, to the byte value.
Return Value
None.
Example  
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!