memcpy

Copies length characters from one buffer to another buffer (function or macro)

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:Memory Manipulation

Syntax

  #include <string.h>  
   
  void *memcpy  (  
     void         *dst,   
     const void   *src,   
     size_t        length);
  

Parameters

dst
(IN) Points to a buffer into which to copy the characters.
src
(IN) Points to a buffer containing the characters to be copied.
length
(IN) Specifies the number of characters to copy.

Return Values

memcpy returns dst.

Remarks

The memcpy function or macro copies length characters from the buffer pointed to by src into the buffer pointed to by dst. Copying of overlapping objects have undefined results. See the memmove function to copy objects that overlap.

See Also

memchr, memcmp, memmove, memset

Example

  #include <string.h>  
   
  main ()  
  {  
     char buffer[80];  
     memcpy (buffer, "Hello", 5);  
  }