Name

memcpy - copies memory area

Library

libc.lib

Synopsis

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

Return values

The memcpy function returns the original value of dst.

Detailed description

The memcpy function copies len bytes from string src to string dst.

Examples

#include <string.h>
#include <stdio.h>
int main()
{
    char one[50] = {"\0"};
    (void) memcpy(one, "abcdefgh",8);
    printf("String after memcpy %s\n",one);
    (void) memcpy(one, "Hello",5);
    printf("String after memcpy %s\n",one);
    return 0;   
}

         

Output

String after memcpy abcdefgh
String after memcpy Hellofgh

         

See also

bcopy, memccpy, memmove, strcpy

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top